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

Are C and C++ a prerequisite for learning Java?
yes..syntax of java is same as a c and c++..so it the advantage if you know any one of these.
Mrunal
0 0
5
Why is C programming language called C?
The C programming language is named "C" because it is a successor to the B programming language. The B language was developed at Bell Labs by Ken Thompson and Dennis Ritchie. When they created C, they...
Ashwini
0 0
6
Which websites are best to learn C programming?
There are several reputable websites where you can learn C programming. Here are some popular ones: GeeksforGeeks (geeksforgeeks.org): Offers a wide range of tutorials, practice problems, and articles...
Sarath Chandra
0 0
5
What is the use of header files in C language?
In summary, header files in C serve as a means of organizing code, providing function prototypes and shared declarations, promoting modularity, and facilitating code reuse. They are essential in large...
Kamal
0 0
6

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

Ask a Question

Related Lessons

C Program-String Palindrome
//Header files #include<stdio.h>#include<conio.h>#include<string.h> //Main function void main(){ char mystring; int i,length; int flag=0; //Function for clearing screen clrscr();...

Some interview questions and answers for fresher level on Pointers
What is a void pointer? Void pointer is a special type of pointer which can reference or point to any data type. This is why it is also called as Generic Pointer. As a void pointer can point to...

Everything about printf in C language
What is printf and from where it comes from in C code.? You must have used printf so many times in your Car programs but do you really know everything about printf? Let's see. What is the full form...

Structures in C
A structure is a collection of one or more data members possibly of different data types, grouped together under a single name for convenient handling. Defining a Structure: In general terms,...

Be prepared to get trained--init
Before starting the training,students must be mentally prepared for acceptance of new knowledge. Students must attend training with open minded forgetting the position they are working.This will help...
S

Smartnub Softsolutions

0 0
0

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