Category: String

21
May
2017

Another Good Example of Struct using Function and Pointer

code: #include<stdio.h> typedef struct { int roll; char name[20]; double gp; double phy,chem,math; }sTudent; void inputStudent(sTudent *sp)…

21
May
2017

Using function with Struct user defined type also pointer

code: #include<stdio.h> typedef struct { int roll; char name[20]; double gp; } sTudent; void inputStudent(sTudent *sp) {…

21
May
2017

Array of String

theortecical concept source: http://stackoverflow.com/questions/20347170/char-array-and-char-array code: char *array = “One good thing about music”; char array[] = {“One”,…

19
May
2017

Char Pointer Practical Example Using String Input and String/Char Variable Passing

code: #include<stdio.h> void toggleChar(char *sptr){ int i; for(i=0;*(sptr+i)!=’\0′;i++) { if(*(sptr+i)>=’a’ && *(sptr+i)<=’z’) *(sptr+i)=*(sptr+i)-32; else if(*(sptr+i)>=’A’&& sptr[i]<=’Z’) *(sptr+i)=*(sptr+i)+32;…

18
May
2017

Lowercase to Uppercase with array

code: #include<stdio.h> char converter() { char ch[100]; gets(ch); int t,l,i; for(i=0; ch[i]!=’\0′; i++); //printf(“%d”,i); for(t=0; t<i; t++)…

13
May
2017

Extract Digits From a Number and Make a Sum of all the digits and show this in C

Code is here: #include<stdio.h> int main() { int number; scanf(“%d”,&number); char digits[2000000]; int i=0,d; while(number>0) { d=number%10;…