13. When would you use a pointer to a function? Pointers to functions are interesting when you pass them to other functions. A function that takes function pointers says, in …
Questions and Answers
- C ProgrammingInterview Questions and AnswersTechnical Interview Questions and Answers
- C ProgrammingInterview Questions and AnswersTechnical Interview Questions and Answers
C Language Pointer Interview Questions and Answers For Freshers Part-5
by Sby S9. Is NULL always equal to 0(zero)? The answer depends on what you mean by “equal to.” If you mean “compares equal to,” such as if ( /* … */ …
- C ProgrammingInterview Questions and AnswersTechnical Interview Questions and Answers
C Language Pointer Interview Questions and Answers For Freshers Part-4
by Sby S7. Can you subtract pointers from each other? Why would you? If you have two pointers into the same array, you can subtract them. The answer is the number of …
- C ProgrammingInterview Questions and AnswersTechnical Interview Questions and Answers
C Language Pointer Interview Questions and Answers For Freshers Part-3
by Sby S5. What is a void pointer? A void pointer is a C convention for “a raw address.” The compiler has no idea what type of object a voidpointer “really points …
- C ProgrammingInterview Questions and AnswersTechnical Interview Questions and Answers
C Language Pointer Interview Questions and Answers For Freshers Part-2
by Sby S3. What is a null pointer? There are times when it’s necessary to have a pointer that doesn’t point to anything. The macro NULL, defined in <stddef.h>, has a value …
- C ProgrammingInterview Questions and AnswersTechnical Interview Questions and Answers
C Language Pointer Interview Questions and Answers For Freshers Part-1
by Sby S1. What is indirection? If you declare a variable, its name is a direct reference to its value. If you have a pointer to a variable, or any other object …
- C ProgrammingInterview Questions and AnswersTechnical Interview Questions and Answers
C Language String Interview Questions and Answers For Freshers Part-5
by Sby S9. How can you tell whether two strings are the same? The standard C library provides several functions to compare two strings to see whether they are the same. One …
- C ProgrammingInterview Questions and AnswersTechnical Interview Questions and Answers
C Language String Interview Questions and Answers For Freshers Part-4
by Sby S7. How can I convert a number to a string? The standard C library provides several functions for converting numbers of all formats (integers, longs, floats, and so on) to …
- C ProgrammingInterview Questions and AnswersTechnical Interview Questions and Answers
C Language String Interview Questions and Answers For Freshers Part-3
by Sby S5. How can I pad a string to a known length? Padding strings to a fixed length can be handy when you are printing fixed-length data such as tables or …
- C ProgrammingInterview Questions and AnswersTechnical Interview Questions and Answers
C Language String Interview Questions and Answers For Freshers Part-2
by Sby S3. How can I remove the leading spaces from a string? The C language does not provide a standard function that removes leading spaces from a string. It is easy, …