The Whole Half-Life
TWHL
Forums
Wiki
Vault
Competitions
Discord
More...
Journals
News
Polls
Members
Go
Go
Login
Email or Username
Password
Remember Me
Login
Forgot Your Password?
Register
The Whole Half-Life
Level design resources for GoldSource, Source, and beyond
Featured mod:
TWHL Tower 2
by
TWHL members
Forums
Wiki
Vault
Competitions
Discord
Community
Journals
News
Polls
Members
Login/Register
Remember Me
Login
Forgot Your Password?
New user?
Create an account
Noob question about C++
Created
17 years ago
2007-10-19 09:55:48 UTC
by
Spike
Forums
General Discussion
View Thread
Created
17 years ago
2007-10-19 09:55:48 UTC
by
Spike
Spike
Posted
17 years ago
2007-10-19 09:55:48 UTC
Post #236657
Im doing some noob homework for university, and I have a noob question.
else if (s ==59)
s = 0, m++ ;
It is correct to write this?
Spike
ZombieLoffe
Posted
17 years ago
2007-10-19 09:59:33 UTC
Post #236658
I've never written or worked with C++, but needs {}? I.e. should be
else if (s == 59) { s = 0; m++; }
ZombieLoffe
ChickenFist
Posted
17 years ago
2007-10-19 10:02:18 UTC
Post #236659
ZombieLoffe is right, but
else if (s == 59) s = 0; m++;
would work too.
ChickenFist
<Witty Title>
Spike
Posted
17 years ago
2007-10-19 10:13:37 UTC
Post #236660
Ok thnx, my teachers prefer to write it all on a line (if it is not too large). Thnx
Spike
Spike
Posted
17 years ago
2007-10-19 10:51:18 UTC
Post #236662
Another noob question
i = i-1; can be write as i--?
Spike
Daubster
Posted
17 years ago
2007-10-19 13:19:06 UTC
Post #236665
Yup.
Same with i++ instead of i = i + 1;
You can also use i += 10 instead of i = i + 10;
Daubster
Vault Dweller
Spike
Posted
17 years ago
2007-10-19 14:52:06 UTC
Post #236670
Thnx
Spike
You must be logged in to post a response.