Re: stupid error doing my head it! (C programming)
From: Will Twentyman (wtwentyman_at_read.my.sig)
Date: 07/14/04
- Next message: Shayne Wissler: "Re: Static vs. Dynamic typing (big advantage or not)---WAS: c.programming: OOP and memory management"
- Previous message: Gerry Quinn: "Re: stupid error doing my head it! (C programming)"
- In reply to: spleen: "stupid error doing my head it! (C programming)"
- Next in thread: Tomasz Zielonka: "Re: stupid error doing my head it! (C programming)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 14 Jul 2004 11:49:19 -0400
spleen wrote:
> Hiya,
>
> Im using visual C++ 6.0 to write my code and when i go to compile im
> getting a stupid error that i just can't figure out how to solve no
> matter how i look at it, as im sure im right! this is the error it
> throws up..
>
> error C2106: '=' : left operand must be l-value
>
> ive used google and tried to find if theres a work around but as far
> as im concerned im correct (probably wont be....
>
> heres my code, if that would help...I dont like asking for help but
> its been 2hrs ive tried to fix it now and it just doesnt work for some
> reason thats a mystery to me!
Let's start with buffer not clearly defined in this code snippet.
> for(h=1; h>=height; h++)
This loop either never runs or never stops.
> {
> for(w=1; w>=width; w++)
This loop either never runs or never stops.
> {
> int i = 1;
> char ascii[10];
> char c[10];
> int a;
>
> c = buffer[i]; */offending line/*
c is a const pointer to char, buffer[i] is presumably of type char. c
is not an l-value (something that can be reassigned).
> sprintf( ascii, "%d", c );
> a = atoi(ascii);
>
> fprintf(f, "%d, %d, %d\n", h, w, a);
> i = i + 1;
> }
> }
> while(h * w <= height * width);
This is a loop that either never runs or never halts.
>
> where i have put */offending line/* is where the complier says is my
> error,
>
> thanks for any advice!
Believe the compiler when it gives you an error. The compiler is either
correct or not standards compliant, but those are about the only two
options.
-- Will Twentyman email: wtwentyman at copper dot net
- Next message: Shayne Wissler: "Re: Static vs. Dynamic typing (big advantage or not)---WAS: c.programming: OOP and memory management"
- Previous message: Gerry Quinn: "Re: stupid error doing my head it! (C programming)"
- In reply to: spleen: "stupid error doing my head it! (C programming)"
- Next in thread: Tomasz Zielonka: "Re: stupid error doing my head it! (C programming)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|