Click here to Skip to main content
15,899,825 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: linux segmentation fault strtok!? Pin
David Crow5-Apr-05 5:58
David Crow5-Apr-05 5:58 
GeneralRe: linux segmentation fault strtok!? Pin
ThinkingPrometheus5-Apr-05 6:06
ThinkingPrometheus5-Apr-05 6:06 
GeneralRe: linux segmentation fault strtok!? Pin
David Crow5-Apr-05 6:19
David Crow5-Apr-05 6:19 
GeneralRe: linux segmentation fault strtok!? Pin
ThinkingPrometheus5-Apr-05 6:29
ThinkingPrometheus5-Apr-05 6:29 
GeneralRe: linux segmentation fault strtok!? Pin
David Crow5-Apr-05 6:38
David Crow5-Apr-05 6:38 
GeneralRe: linux segmentation fault strtok!? Pin
ThinkingPrometheus5-Apr-05 6:42
ThinkingPrometheus5-Apr-05 6:42 
GeneralRe: linux segmentation fault strtok!? Pin
Michael Dunn5-Apr-05 7:00
sitebuilderMichael Dunn5-Apr-05 7:00 
GeneralRe: linux segmentation fault strtok!? Pin
David Crow5-Apr-05 7:03
David Crow5-Apr-05 7:03 
ThinkingPrometheus wrote:
much more i'm asking why it doesn't work

Because it is not supposed to work. The statement char *p = "Hello" says that p is a pointer that points to a spot in memory that holds the string constant. Trying to change the contents of p[1] is illegal because is refers to a constant spot in memory. That spot in memory has no name.

The statement char p[] = "Hello" says that 6 bytes of memory is allocated for the string constant and that spot in memory is referred to as p.

In that link that I provided, read sections 6.2 and 6.4 very carefully. The difference is explained very well, and why they can't always be interchanged.


"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow


GeneralRe: linux segmentation fault strtok!? Pin
ThinkingPrometheus5-Apr-05 7:19
ThinkingPrometheus5-Apr-05 7:19 
Generalproperty sheets apply event Pin
laiju5-Apr-05 4:07
laiju5-Apr-05 4:07 
GeneralRe: property sheets apply event Pin
David Crow5-Apr-05 4:11
David Crow5-Apr-05 4:11 
GeneralRe: property sheets apply event Pin
PJ Arends5-Apr-05 9:35
professionalPJ Arends5-Apr-05 9:35 
GeneralHiding the default MDI Child Pin
laiju5-Apr-05 3:58
laiju5-Apr-05 3:58 
GeneralRe: Hiding the default MDI Child Pin
YaronNir5-Apr-05 5:11
YaronNir5-Apr-05 5:11 
GeneralRe: Hiding the default MDI Child Pin
rgchezhian5-Apr-05 5:57
rgchezhian5-Apr-05 5:57 
GeneralRe: Hiding the default MDI Child Pin
laiju5-Apr-05 6:00
laiju5-Apr-05 6:00 
GeneralRe: Hiding the default MDI Child Pin
PJ Arends5-Apr-05 10:54
professionalPJ Arends5-Apr-05 10:54 
GeneralRe: Hiding the default MDI Child Pin
laiju5-Apr-05 16:42
laiju5-Apr-05 16:42 
GeneralCPropertyPage/CPropertySheet failing Pin
Fantmx5-Apr-05 3:57
Fantmx5-Apr-05 3:57 
GeneralHelp! Dll problem Pin
xiao_in5-Apr-05 3:40
xiao_in5-Apr-05 3:40 
GeneralRe: Help! Dll problem Pin
liquid_5-Apr-05 6:44
liquid_5-Apr-05 6:44 
GeneralRe: Help! Dll problem Pin
xiao_in5-Apr-05 15:36
xiao_in5-Apr-05 15:36 
GeneralDrawing Outside Window Pin
syedfairoz5-Apr-05 2:59
syedfairoz5-Apr-05 2:59 
GeneralRe: Drawing Outside Window Pin
ThatsAlok5-Apr-05 3:35
ThatsAlok5-Apr-05 3:35 
QuestionWhy is this Crash??? Pin
Balkrishna Talele5-Apr-05 2:49
Balkrishna Talele5-Apr-05 2:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.