Skip to content

Tag Archives: C-String

isspace() function In C++, isspace is a predefined function used for string and character handling.cstring is the header file required for string functions and cctype… Read More
Base 64 is an encoding scheme that converts binary data into text format so that encoded textual data can be easily transported over network un-corrupted… Read More
Strings are defined as an array of characters. The difference between a character array and a string is the string is terminated with a special… Read More
strcpy() is a standard library function in C/C++ and is used to copy one string to another. In C it is present in string.h header… Read More
strcmp() is a built-in library function and is declared in <string.h> header file. This function takes two strings as arguments and compare these two strings… Read More
Below is syntax of Scanf. It requires two arguments: scanf("Format Specifier", Variable Address); Format Specifier: Type of value to expect while input Variable Address: &variable… Read More
Output of following C program? Assume that all necessary header files are included int main() {     char *s1 = (char *)malloc(50);     char *s2 = (char… Read More
Write a function mysubstr() in C that doesn’t use any string function, doesn’t use any loop and prints substring of a string. The function should… Read More
Write a C function print(n) that takes a long int number n as argument, and prints it on console. The only allowed library function is… Read More
Predict the output of following program, assume that a character takes 1 byte and pointer takes 4 bytes. #include <stdio.h> int main() {     char *str1… Read More
Assume that a character takes 1 byte. Output of following program? #include<stdio.h> int main() {     char str[20] = "GeeksQuiz";     printf ("%d", sizeof(str));     return 0; }… Read More
Find the length of a string without using any loops and string.h in C. Your program is supposed to behave in following way:  Enter a… Read More
int main() {     char p[] = "geeksquiz";     char t;     int i, j;     for(i=0,j=strlen(p); i<j; i++)     {         t = p[i];         p[i] = p[j-i];         p[j-i] = t;… Read More
Output of following program #include <stdio.h> int fun(char *p) {     if (p == NULL || *p == '\0') return 0;     int current = 1, i… Read More
Predict the output of the following program: #include <stdio.h> int main() {     char str[] = "%d %c", arr[] = "GeeksQuiz";     printf(str, 0[arr], 2[arr + 3]);… Read More