char In structures
From: duramax (no_at_email.com)
Date: 05/30/04
- Next message: Bob Hairgrove: "Re: Order of Static Members"
- Previous message: Alf P. Steinbach: "Re: Why do I want RTTI?"
- Next in thread: Daniel T.: "Re: char In structures"
- Reply: Daniel T.: "Re: char In structures"
- Reply: John Carson: "Re: char In structures"
- Reply: JKop: "Re: char In structures"
- Reply: Gianni Mariani: "Re: char In structures"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 30 May 2004 12:59:42 -0400
Hi,
I'm getting some weird results for the following code:
#include "stdafx.h"
#include <stdlib.h>
typedef struct ALLO
{
char a[3];
char b[4];
} Allo;
int _tmain(int argc, _TCHAR* argv[])
{
Allo al;
strcpy(al.a, "aloe");
strcpy(al.b, "vcxzv");
return 0;
}
I get an error "stack around arround the 'al' variable was corrupted". I
think that strcpy in this case isn't good but I can't realy tell... If it is
how could I set my char in my structure else than with strcpy?
TIA, Max.
- Next message: Bob Hairgrove: "Re: Order of Static Members"
- Previous message: Alf P. Steinbach: "Re: Why do I want RTTI?"
- Next in thread: Daniel T.: "Re: char In structures"
- Reply: Daniel T.: "Re: char In structures"
- Reply: John Carson: "Re: char In structures"
- Reply: JKop: "Re: char In structures"
- Reply: Gianni Mariani: "Re: char In structures"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|