Click here to Skip to main content
15,896,437 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C++ reading out memory specs Pin
Fatbuddha 124-Mar-09 5:33
Fatbuddha 124-Mar-09 5:33 
GeneralRe: C++ reading out memory specs Pin
Michael Schubert24-Mar-09 5:45
Michael Schubert24-Mar-09 5:45 
GeneralRe: C++ reading out memory specs Pin
Fatbuddha 124-Mar-09 6:19
Fatbuddha 124-Mar-09 6:19 
GeneralRe: C++ reading out memory specs Pin
Michael Schubert24-Mar-09 6:28
Michael Schubert24-Mar-09 6:28 
GeneralRe: C++ reading out memory specs Pin
David Crow24-Mar-09 6:39
David Crow24-Mar-09 6:39 
AnswerRe: C++ reading out memory specs Pin
Iain Clarke, Warrior Programmer24-Mar-09 8:39
Iain Clarke, Warrior Programmer24-Mar-09 8:39 
GeneralRe: C++ reading out memory specs Pin
Fatbuddha 126-Mar-09 22:52
Fatbuddha 126-Mar-09 22:52 
Questionsegmentation fault en strcat() Pin
sankariyo24-Mar-09 4:58
sankariyo24-Mar-09 4:58 
Hello.

My program gets "segmentation fault" in "strcat(string,stringaux)" and it is strange because I am sure that string always has space for adding the new stringaux due to before call strcat I check if size of the destiny plus new stringaux is less than string capacity:

char string[100];
char stringaux[3];

void Function()
{
if ((strlen(string)+strlen(stringaux))<100)
{
strcat(string,stringaux)
}
}


In this way strcat() never can make string be longer than 100. But still I get SEGMENTATION DEFAULT.

I have been reading, and the explanation can be that the Stack gets full due to I have many local variables or ...

Is there anybody can tell me some ideas about why SEGMENTATION DEFAULT is produced in strcat() when I am sure that is not because there is not space in the destiny string?

Thanks in advance.
AnswerRe: segmentation fault en strcat() Pin
Code-o-mat24-Mar-09 5:17
Code-o-mat24-Mar-09 5:17 
GeneralRe: segmentation fault en strcat() Pin
sankariyo24-Mar-09 22:26
sankariyo24-Mar-09 22:26 
GeneralRe: segmentation fault en strcat() Pin
Code-o-mat24-Mar-09 23:04
Code-o-mat24-Mar-09 23:04 
AnswerRe: segmentation fault en strcat() Pin
Michael Schubert24-Mar-09 5:37
Michael Schubert24-Mar-09 5:37 
GeneralRe: segmentation fault en strcat() Pin
sankariyo24-Mar-09 22:39
sankariyo24-Mar-09 22:39 
QuestionRe: segmentation fault en strcat() Pin
David Crow24-Mar-09 6:20
David Crow24-Mar-09 6:20 
AnswerRe: segmentation fault en strcat() Pin
CPallini24-Mar-09 7:09
mveCPallini24-Mar-09 7:09 
GeneralRe: segmentation fault en strcat() Pin
David Crow24-Mar-09 7:14
David Crow24-Mar-09 7:14 
GeneralRe: segmentation fault en strcat() Pin
CPallini24-Mar-09 7:25
mveCPallini24-Mar-09 7:25 
GeneralRe: segmentation fault en strcat() Pin
sankariyo24-Mar-09 22:42
sankariyo24-Mar-09 22:42 
GeneralRe: segmentation fault en strcat() Pin
CPallini24-Mar-09 22:48
mveCPallini24-Mar-09 22:48 
AnswerRe: segmentation fault en strcat() Pin
SrivathsanRaghavan11-Dec-12 19:37
SrivathsanRaghavan11-Dec-12 19:37 
QuestionCRunTimeClass with parameters Pin
prithaa24-Mar-09 4:20
prithaa24-Mar-09 4:20 
AnswerRe: CRunTimeClass with parameters Pin
Akt_4_U24-Mar-09 6:12
Akt_4_U24-Mar-09 6:12 
GeneralRe: CRunTimeClass with parameters Pin
prithaa24-Mar-09 6:23
prithaa24-Mar-09 6:23 
QuestionForm Circular Reference? Pin
thenutz7224-Mar-09 4:00
thenutz7224-Mar-09 4:00 
AnswerRe: Form Circular Reference? Pin
Cedric Moonen24-Mar-09 4:23
Cedric Moonen24-Mar-09 4:23 

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.