![]() |
|
Off Topic Chat All non related chat goes here. |
![]() |
|
Thread Tools | Display Modes |
![]() |
#1 |
I am trying to do something like:
if (blahblah(a)) { ... } This is the function: bool blahblah(a) { bool return (a=5); } but it's giving me undeclared identifier. What's going on? I have #include<iostream> and using namespace std; on top, do I need something else??? I am a freshmen in college, and just learning this, and have no clue how to do it. Someone please help. Thanks a lot. |
|
![]() |
![]() |
Sponsored Links |
![]() |
#5 |
Nissanaholic!
![]() |
First of all, you are supposed to put the type when u declare the function:
e.g - blahblah(int a) second, i think you wonna return (a==5), cuz (a=5) just assignes 5 to a and returns true. and u just do "return ..." instead of "bool return". the program alrdy knows it's bool when u declared the function. Hope this helps |
![]() |
![]() |
![]() |
#6 |
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Kreator @ Sep. 29 2002,3:40)</td></tr><tr><td id="QUOTE">First of all, you are supposed to put the type when u declare the function:
e.g - blahblah(int a) second, i think you wonna return (a==5), cuz (a=5) just assignes 5 to a and returns true. and u just do "return ..." instead of "bool return". the program alrdy knows it's bool when u declared the function. Hope this helps</td></tr></table><span id='postcolor'> Thanks a lot, I figured it out already, it was a mistake in the book about the "bool return", it's just return. Also, I forgot to declare. |
|
![]() |
![]() |
![]() |
#8 |
Post Whore!
![]() Join Date: Feb 2002
Location: Philly
Age: 42
Posts: 9,185
Trader Rating: (0)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Feedback Score: 0 reviews
|
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (aqwkmf @ Sep. 28 2002,10:18)</td></tr><tr><td id="QUOTE">i just started c++ this year too...im a senior in high school....i hope its not to hard</td></tr></table><span id='postcolor'>
It not hard in high school, but wait tell you get to college. I'm at CS 211 (or level 2) and its giving me some tough times. <img src="http://www.zilvia.net/f/iB_html/non-cgi/emoticons/huh.gif" border="0" valign="absmiddle" alt=':huh:'> Hey silvia S13 what college do you go to?
__________________
Goals are dreams with a deadline. L.H.O.O.Q. |
![]() |
![]() |
![]() |
#9 |
Nissanaholic!
![]() |
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (GT specR @ Sep. 29 2002,10:39)</td></tr><tr><td id="QUOTE"></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (aqwkmf @ Sep. 28 2002,10:18)</td></tr><tr><td id="QUOTE">i just started c++ this year too...im a senior in high school....i hope its not to hard</td></tr></table><span id='postcolor'>
It not hard in high school, but wait tell you get to college. I'm at CS 211 (or level 2) and its giving me some trobule. <img src="http://www.zilvia.net/f/iB_html/non-cgi/emoticons/huh.gif" border="0" valign="absmiddle" alt=':huh:'></td></tr></table><span id='postcolor'> Lol, wait till you get to level 4 <img src="http://www.zilvia.net/f/iB_html/non-cgi/emoticons/smile.gif" border="0" valign="absmiddle" alt=' ![]() |
![]() |
![]() |
![]() |
#10 |
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (GT specR @ Sep. 29 2002,10:39)</td></tr><tr><td id="QUOTE"></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (aqwkmf @ Sep. 28 2002,10:18)</td></tr><tr><td id="QUOTE">i just started c++ this year too...im a senior in high school....i hope its not to hard</td></tr></table><span id='postcolor'>
It not hard in high school, but wait tell you get to college. I'm at CS 211 (or level 2) and its giving me some tough times. <img src="http://www.zilvia.net/f/iB_html/non-cgi/emoticons/huh.gif" border="0" valign="absmiddle" alt=':huh:'> Hey silvia S13 what college do you go to?</td></tr></table><span id='postcolor'> I am at Stevens Insititute of Technology, it's hard as hell. I regret coming here. It's a geek school. What bout you guys? Comp Sci is my major, but the classes have been easy so far, except that they don't teach and just tell you to read, and when there's a mistake in the book, it completely fucks me over like this time. |
|
![]() |
![]() |
![]() |
#11 |
Nissanaholic!
![]() |
University of Maryland College Park <- one of the top 10 comp sci schools <img src="http://www.zilvia.net/f/iB_html/non-cgi/emoticons/smile.gif" border="0" valign="absmiddle" alt='
![]() |
![]() |
![]() |
![]() |
Bookmarks |
|
|