Skip to content

Tag Archives: C-String

In C/C++, strncat() is a predefined function used for string handling. string.h is the header file required for string functions.This function appends not more than… Read More
strrchr() function In C++, strrchr() is a predefined function used for string handling. cstring is the header file required for string functions.This function returns a pointer… Read More
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
String in C programming is a sequence of characters terminated with a null character ‘\0’. Strings are defined as an array of characters. The difference… 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

Start Your Coding Journey Now!