Structure Initialization
Initialization: There are many methods to initialize the structure. Some of the following examples are: Compile time initialization: 1. struct student { int roll_num; float percentage; } s1={1117,80.11}; In this …
Initialization: There are many methods to initialize the structure. Some of the following examples are: Compile time initialization: 1. struct student { int roll_num; float percentage; } s1={1117,80.11}; In this …
There are four main categories of the functions these are as follows: 1. Function with no arguments and no return values. 2. Function with no arguments and a return value. …
Function call: In function call there are following three parts: a. Function name b. Actual arguments c. Semicolon Function name is must be same as we declared in our program …
Function declaration: function declaration is must before call the function. And it divides into four parts as follows a. Return-type b. Function-name c. Parameter d. semicolon The above three parts …
Function definition: function definition contains the statements which we want to perform some specific task according to requirement. Syntax: return-type function-name(parameters) { Variable declaration; Statement1; ————— ————— Return statement; } …
String handling functions: 1. strlen(): This function tells the number of character in a string. This will be as follows: l=strlen(string); where l is integer. 2. strcat(): This function is …
Printf(): we can print the string very easily using the printf() function using ‘%s’ as follows: Syntax: printf(“%s”,variable); e.g: printf(“%s”,str); putchar(): putchar() function is use to print the single …
String declaration: There is no string data type in c. So string is declared as the array of characters. Syntax: char variable-name[size]; e.g: char S[10]; String initialization: like the integer …