I know, it gives a warning but this should not crash the program . I am downloading CodeBlocks and change the settings. Let's see what happens.
thanks for replying.
Another:
Sometimes when I click on workspace , the background is faded and then Code Blocks crashes.
I experienced this issue back when I used code blocks. When I went to report the bug, the only response that I got was along the lines of "you have the source, fix it". If this bug is still around, it's most likely not a trivial fix...either that or the maintainers do not feel that it's a serious enough bug to fix.
C::B hasn't crashed in ages for me (not counting one particular bug that happens after a few hours).
It's likely that the bug was fixed a long time ago. You just need to make sure that you always have the latest version.
Do you understand that "Hello" is a string literal and you only store its memory address in a pointer?
1 2 3
char s[] = "Hello"; // char array with content `Hello`
char *p1 = "Hello"; // pointer to string literal constant `"Hello"`, and so it should be:
constchar *p2 = "Hello";
Good old C language has "compound literals", but a C++ compiler may or may not support them (because after all, C and C++ are two different languages):