In this section you can learn and practice C Programming Questions based on "Strings" and improve your skills in order to face the interview, competitive examination and various entrance test (CAT, GATE, GRE, MAT, Bank Exam, Railway Exam etc.) with full confidence.
Where can I get C Programming Strings questions and answers with explanation?
IndiaBIX provides you lots of fully solved C Programming (Strings) questions and answers with Explanation. Solved examples with detailed answer description, explanation are given and it would be easy to understand. All students, freshers can download C Programming Strings quiz questions with answers as PDF files and eBooks.
Where can I get C Programming Strings Interview Questions and Answers (objective type, multiple choice)?
Here you can find objective type C Programming Strings questions and answers for interview and entrance examination. Multiple choice and true or false type questions are also provided.
How to solve C Programming Strings problems?
You can easily solve all kind of C Programming questions based on Strings by practicing the objective type exercises given below, also get shortcut methods to solve C Programming Strings problems.
It scans a string s in the reverse direction, looking for a specific character c.
Example:
#include <string.h>
#include <stdio.h>
int main(void)
{
char text[] = "I learn through IndiaBIX.com";
char *ptr, c = 'i';
ptr = strrchr(text, c);
if (ptr)
printf("The position of '%c' is: %d\n", c, ptr-text);
else
printf("The character was not found\n");
return 0;
}
Return Value:
On success, strstr returns a pointer to the element in s1 where s2 begins (points to s2 in s1).
On error (if s2 does not occur in s1), strstr returns null.