D
Duke
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[])
{
char *s = "hello strlen";
printf("%s has %d chars.\n", s, strlen(s));
//the above strlen function execute correctly
char *msg1 = "abcdefghijklmnopqrstuvwxyz";
char buf[10];
strcpy(buf, msg1);
printf("[%s] length: %d\n", msg1, strlen(msg1));
//but the above statement will throw a runtime os exception
system("PAUSE");
return 0;
}
I don't know what occus after I find all the resource about c which I
can find.
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[])
{
char *s = "hello strlen";
printf("%s has %d chars.\n", s, strlen(s));
//the above strlen function execute correctly
char *msg1 = "abcdefghijklmnopqrstuvwxyz";
char buf[10];
strcpy(buf, msg1);
printf("[%s] length: %d\n", msg1, strlen(msg1));
//but the above statement will throw a runtime os exception
system("PAUSE");
return 0;
}
I don't know what occus after I find all the resource about c which I
can find.