Visual Studio 6.0 C/C++ Bug ?

Started by
25 comments, last by Estor 21 years, 1 month ago
Hello Let me introduse problem, this pice of code: char *var_a = "b"; int main () { char *var_b = "a"; var_a[0] = ''A''; var_b[0] = ''B''; return (0); } generates Acces Valiation when compiled with Visual 6.0 C/C++. When I compile it on Borland 5.1 C/C++ it works corect. Prabobly Visual C is puting this pointers in code memory (referenced by [CS] Descryptor). Is there any switch to force alocating data in data memory ? Maybe there is other reason why it is not workin corectly only when compiled with Visual C. "Never use brutal force, always HAMMER !!!"
"The Gods Made Heavy Metal And They Saw That It Was Good They Said To Play It Louder Than Hell We Promised That We WouldWhen Losers Say Its Over With You Know That It's A Lie The Gods Made Heavy Metal And It's Never Gonna Die"THE GODS MADE HEAVY METAL/by ManOwaR
Advertisement
var_a is pointing to a constant string. Can''t modify it.
That goes for var_b too, of course
Except that I meant "string literal" instead of "constant string"
you are very talkative today mr anonymos poster.
do this insted:
char var_a[] = "123456789";
becoz therfore you can now altar it.
hallelooya and praze jesus!
estor i am compeled to note that your spelling is atrosious. how cvan you expect to become a good programer when your gramar skills are so obsenely limited?
quote:Original post by YodaTheCoda
estor i am compeled to note that your spelling is atrosious. how cvan you expect to become a good programer when your gramar skills are so obsenely limited?


Sorry... I understand what im reading, but I have problems with writeing. But all the time I''m learning. 8)
"The Gods Made Heavy Metal And They Saw That It Was Good They Said To Play It Louder Than Hell We Promised That We WouldWhen Losers Say Its Over With You Know That It's A Lie The Gods Made Heavy Metal And It's Never Gonna Die"THE GODS MADE HEAVY METAL/by ManOwaR
Yoda: Green little aliens backwards talkin does who, whine grammar shouldn''t about
YodaTheCoda: How good is your Polish, kiwi boy?

This topic is closed to new replies.

Advertisement