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

In Java programming, what are the differences between the functions of 'int' and 'int []' when working with an array?
The may appear as part of the type at the beginning of the declaration, or as part of the declarator for a particular variable but But int a keeps type information together and is more verbose so I prefer it.
Kalpana
0 0
5
What is the most efficient way to store flag values?
A flag is a value used to make a decision between two or more options in the execution of a program. Efficiency in this case is a tradeoff between size and speed. The most memory-space efficient way to...
Deepak
0 0
6
in c : i want run time input: data=[name:raj,age:20] output: value[0]=raj value[1]=20 i want c code
Make use of Command line argument and access using argv,argc.
Vanaraj
Which is the best C language IDE/compiler for Windows?
Let us now check out some of the famous and best-working IDEs available. Visual Studio Code. Visual Studio Code is one of the most popular IDEs and is open-source software developed by Microsoft....
Deepashri
0 0
5
how much time does it take to learn c language from basic to advance range
3 month and also depend in your skill to learning power...
Nithin

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

Ask a Question

Related Lessons

Necessity of Theory and Practical in Computer Science.
Upon studying a subject both theory and practical are important. Usually many schools concentrate more on theory and the marks not on the practical. Other and opposite kind of people prefer practical...

Software Development Training In Jaipur
Satyam Web Solution provides website designing &development and software designing &development training in Jaipur for various stream’s students. MCA 6 month Industrial Training/Internship B....

C Program-String Comparison
// WAP to compare strings entered by the user //Header files #include<stdio.h>#include<conio.h>#include<string.h> //Main function void main(){ char str1; char str2; int comp; //Function...

Operators in C
Operators in C Operator: An operator is a symbol that tells the compiler to perform certain mathematical or logical calculations. Operators are used in programs to manipulate data and variables. The...

What Would Be Life Cycle Of A Fresher After Campus In An IT Company?
1. Basic Technical Training: Since freshers are not subject matter experts so gone through 3 - 6 months basic technical training within Organization. 2. Technical Assessment: HR sends freshers to various...

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