hilarius, so you mean two following two lines are the same, right?
char *p = "abc";
const char *p = "abc";
And, if you know C++, is it the reason that g++ will warn char *p = "abc" for p is...
Type: Posts; User: lilydjwg
hilarius, so you mean two following two lines are the same, right?
char *p = "abc";
const char *p = "abc";
And, if you know C++, is it the reason that g++ will warn char *p = "abc" for p is...
If so, why can I when in gdb or use char p[] instead of char *p? What's the difference between them?
#include<stdio.h>
int main(){
char *p = "Abc";
*p = 'a';
printf("%s\n", p);
return 0;
}
It received SIGSEGV on the 3rd line. But if I use
char p[] = "Abc";, it goes well.
So why I...
Oh, I see. Thank you!
Hi there,
Here is what I've tried:
#include<stdio.h>
int main(){
char str[10];
int a;