Re: [of topic] programming problems...

From: Michele Andreoli (
Date: Wed Jan 16 2002 - 19:32:35 CET

On Wed, Jan 16, 2002 at 07:36:14PM +0200, Vesa-Pekka Palmu nicely wrote:

> the code that is causing the problem is (in sort form) something
> like this:
> void main (void)
> {
> char variable[25];
> variable="string";
> }
> I have used all my little knowledge of programming on this one, but
> the problem remains and my hair is getting shorter :(

This code cannot work. You have these chances:

        static char variable[25]="string";

        char variable[25];

        char *variable="string";

When you define "char variable[25]", the C language simply create
a constant pointer called "variable" to a 25-byte area.
With the instruction :

you didn't load a content in the area; you simply tried to change
the constant pointer!

This is the wonderfull world of C :-)


I keep trying to locate a meeting of Quantum Physicists. But everytime
they set a meeting time, the location changes. And vice versa -- Anonymous
To unsubscribe, e-mail:
For additional commands, e-mail:

This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:21 CET