












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













Dr. Hanif Durad^
2
D:\C\CSCI-1190\ lecture-4.ppt, P-2 a = a + b;a -= b; a = a – b;a *= b; a = a * b;a /= b; a = a / b;a %= b; a = a % b;
printf("%d\n",a);
printf("%d\n",b--);
printf("%d\n",b); postfix.c^ /* 9 */
printf("%d\n",a);
printf("%d\n",--b);
printf("%d\n",b);
/* error */ b=2;^
/* error */ for(i=0;i<5;i++){ a[i]=1; b[i]=2; }
/* ok */ c=a+b;^
/* error */ for(i=0;i<5;i++)c[i]=a[i]+b[i];
/* ok */
/* error */ a[10]=1;^
/* error */ a[15]=1;^
/* error */ a[r]=1;^
/* error */ j=r;^
/* j=1 */ a[j]=1;^
/* okay */
D:\C\Hanif Search\C.tn.pdf
Dr. Hanif Durad^
12
Dr. Hanif Durad^
17 string1.c
Dr. Hanif Durad^
18 string2.c
Dr. Hanif Durad^
20 string3.c
Dr. Hanif Durad^
21
Function^
Description strcpy(string1, string2)
Copy string2 into string strcat(string1, string2)^
Concatenate string2 onto the end of string length = strlen(string)^
Get the length of a string strcmp(string1,string2)
Return 0 if string1 equals string2, otherwisenonzero strchr(string1, chr);^
will find the first matching character in a string