Welcome! Log In Create A New Profile

Advanced

Help With If and Content ID

Posted by pokeglobe 
Help With If and Content ID
March 06, 2010 10:43PM
Ok, I am having a hard time with If.


I have this to read it.
printf("Reading contents... %d",content[id].conid);

It will show on the screen fine as the number. It reads contents from a wad.
But it reads IOS36 contents on the screen like this:
27
16
22
3
17
5
6
18
19
9
10

But how can I make it something like this:
if it = 5 then print it off.

I tried something like this:
if (content[id].conid = 16)
{
stuff here
}

It gives a warning:
suggest parentheses around assignment used as truth value

On screen it shows the stuff here on each content.
Any help would be great, thanks.
Re: Help With If and Content ID
March 06, 2010 10:58PM
Quote
pokeglobe
I tried something like this:
if (content[id].conid = 16)
{
stuff here
}

It gives a warning:
suggest parentheses around assignment used as truth value
C newb mistake. It should be:
if (content[id].conid == 16)
Re: Help With If and Content ID
March 07, 2010 03:27AM
I never noticed that it was 2 = signs >_>

It didn't give a warning this time. I'll tell how it worked in the morning.
Sorry, only registered users may post in this forum.

Click here to login