edited by
461 views
0 votes
0 votes
int main(int argc, char *argv[]) {
    
    int valid = 0;
    char str1[8] = "start";
    char str2[8];
    gets(str2);
    if (strncmp(str1, str2, 8) == 0) valid = 1;
    printf("buffer1: str1(%s), str2(%s), valid(%d)\n", str1, str2, valid);

}

edited by

Please log in or register to answer this question.

Related questions

1 votes
1 votes
0 answers
1
1 votes
1 votes
2 answers
2
radha gogia asked Aug 9, 2015
1,857 views
If I write #include<stdio.h int a; main() { //code }then since a is a global variable so what is the storage class of it , is it extern ?
0 votes
0 votes
0 answers
3
aimhigh asked Jan 8, 2019
1,235 views
#include<stdio.h>void main(){int p=-8;int i= (p++,++p);printf("%d\n",i);}
0 votes
0 votes
1 answer
4
Karthik Akula asked Oct 29, 2016
4,068 views
what is the output for the below program ?main() { float x=1/2; float y=1/2.0; printf("%f, %f", x,y); }A) 0.500000, 0.500000B) 0.500000, 0.000000C) 0.000000, 0.000000D) 0...