UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

How can I write my own printf() scanf() functions in C or assembly without using other libraries?

Asked by Last Modified  

Follow 1
Answer

Please enter your answer

Tutor

you can follow below instructions- Learn about variable parameter argument lists in C. Then you might understand the printf/scanf functions better. One of the problems is that you have to parse the first parameter (the format) to determine how many, and what type each parameter is. Variable argument...
read more
you can follow below instructions- Learn about variable parameter argument lists in C. Then you might understand the printf/scanf functions better. One of the problems is that you have to parse the first parameter (the format) to determine how many, and what type each parameter is. Variable argument lists are very useful - it is one way to create functions with named parameters. read less
Comments

Advance Excel And VBA Training

How can I use my own implementation of 'printf()' without needing to recompile my application code? Applies to: DS-5, RealView Development Suite (RVDS) Scenario The compiler normally translates "printfs" in application source code into calls to optimized versions in the ARM-supplied C libraries....
read more
How can I use my own implementation of 'printf()' without needing to recompile my application code? Applies to: DS-5, RealView Development Suite (RVDS) Scenario The compiler normally translates "printfs" in application source code into calls to optimized versions in the ARM-supplied C libraries. This optimization can be disabled by recompiling with the compiler switch -Ono_fp_formats (for RVCT 2.x) or --library_interface=aeabi_clib (for RVCT 3.0 or later) as described by the article: How do the ARM Compilers handle printf, sprintf, fprintf and scanf?. But if the programmer would like to use their own printf implementation without having to recompile their application source code (e.g. because the object code was provided by a third-party and cannot be changed), a different approach is needed. Answer All internal optimized "printfs" are linked-in from the ARM-supplied C libraries at link-time. During compilation, when the compiler sees a call to one of the printf functions and it recognizes the format string or arguments, it will change the call to __Nprintf (where N depends on the ARM Compiler version). The compiler may also need to import various symbols depending on the format string and arguments. For RVCT 2.x/3.0, the renamed symbol is __0printf. It is __1printf for RVCT 3.1 and __2printf for RVCT 4.0 and later versions. Beware that this naming scheme may change in future releases of ARM Compiler Tools. The user should reimplement these renamed symbols to redirect them to their own version of printf. The recommended way is to use an assembly file, for example: AREA retarget_Nprintf, CODE, READONLY IMPORT printf EXPORT __0printf EXPORT __1printf EXPORT __2printf __0printf __1printf __2printf B printf END This assembly file would then work for third party objects that are built using any current version of ARM Compiler. sprintf(), fprintf() and scanf() can be handled in the same way. read less
Comments

Related Questions

What are the flaws of the C programming language?
C programming language does not support Object-oriented programming language
Sounak
0 0
7
How do I get 6 power 13 in c language?
By using pow() function #include <math.h>#include <stdio.h>int main() { double base = 6.0; double exp = 13.0; double result = pow(base, exp); printf("%.1lf^%.1lf = %.2lf", base, exp, result); return 0;}
Tanush
0 0
5
Is it necessary to learn the C language and also C++ before joining an engineering college?
it is not necessary to learn C and C++, but if you want to make your are career in computer then learn C & C++ because these are basic computer language.
J.k.kavyadharshini
Which is the best software for working with C language?
Choosing the best software for C programming often depends on personal preference, but popular options include GCC (GNU Compiler Collection), Visual Studio, and CLion. Consider factors like your platform,...
Kiran
0 0
6
hello sir my name is suryateja i am studying in diploma in computer science and engineering my college complect in c language subject i practice with in simple programs my write to won programs how it you?
Hi Syateja, if I understand your questions correctly let me answer. Best thing to learn and progress is to practice writing programs, initially small programs then gradually can write complex program....
Suryateja

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Memory Layout of C Programs
A typical memory representation of C program consists of following sections. Text Segment: A text segment, also known as a code segment or simply as text, is one of the sections of a program in an object...


Pointers Concept
Every variable has a memory location and every memory location has its address defined which can be accessed using ampersand (&) operator, which denotes an address in memory. Consider the following...

C Program-Infinite Loop[For] Demo
//Header Files #include<stdio.h>#include<conio.h> //Main function void main(){ //Function for clearing screen clrscr(); //Infinite for loop for(;;) { printf("Hello!"); } //Function for...

Facts about C language
C programming language was developed in 1972 by Dennis Ritchie at AT&T Bell Labs. It was developed to overcome the problems of languages such as B, BPCL. It was developed to write the Unix operating...

Recommended Articles

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Applications engineering is a hot trend in the current IT market.  An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...

Read full article >

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more