Zilvia.net Forums | Nissan 240SX (Silvia) and Z (Fairlady) Car Forum

Go Back   Zilvia.net Forums | Nissan 240SX (Silvia) and Z (Fairlady) Car Forum > Specific Topics > Off Topic Chat

Off Topic Chat All non related chat goes here.


Reply
 
Thread Tools Display Modes
Old 09-28-2002, 10:39 PM   #1
silvia S13
 
Join Date: Aug 2002
Posts: 41
Trader Rating: (0)
silvia S13 is an unknown quantity at this point
Feedback Score: 0 reviews
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.



silvia S13 is offline   Reply With Quote
Sponsored Links
Old 09-29-2002, 01:04 AM   #2
fodive
Zilvia Junkie
 
fodive's Avatar
 
Join Date: Jun 2002
Location: Columbia, SC
Age: 40
Posts: 548
Trader Rating: (0)
fodive is an unknown quantity at this point
Feedback Score: 0 reviews
are you using bool blahaha as a global variable, cause i know in C that can give you oodles of trouble, but not sure about C++
__________________
roots.
fodive is offline   Reply With Quote
Old 09-29-2002, 08:34 AM   #3
silvia S13
 
Join Date: Aug 2002
Posts: 41
Trader Rating: (0)
silvia S13 is an unknown quantity at this point
Feedback Score: 0 reviews
blahblah is a function. &nbsp;This is in C++



silvia S13 is offline   Reply With Quote
Old 09-29-2002, 09:23 AM   #4
Titan
Zilvia Junkie
 
Join Date: Apr 2002
Location: Ontario, Canada
Posts: 421
Trader Rating: (0)
Titan is an unknown quantity at this point
Feedback Score: 0 reviews
Did you not define all those if statements in a main() function?
__________________


Sleep Doesn't Drink Beer
Titan is offline   Reply With Quote
Old 09-29-2002, 02:40 PM   #5
Kreator
Nissanaholic!
 
Kreator's Avatar
 
Join Date: Mar 2002
Location: MD
Age: 41
Posts: 1,975
Trader Rating: (0)
Kreator will become famous soon enoughKreator will become famous soon enoughKreator will become famous soon enough
Feedback Score: 0 reviews
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



__________________


кто болеет за Зенит, у того всегда стоит!
Kreator is offline   Reply With Quote
Old 09-29-2002, 04:56 PM   #6
silvia S13
 
Join Date: Aug 2002
Posts: 41
Trader Rating: (0)
silvia S13 is an unknown quantity at this point
Feedback Score: 0 reviews
</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. &nbsp;Also, I forgot to declare.
silvia S13 is offline   Reply With Quote
Old 09-29-2002, 08:18 PM   #7
aqwkmf
Zilvia Junkie
 
Join Date: Apr 2002
Location: not there.
Posts: 414
Trader Rating: (0)
aqwkmf is an unknown quantity at this point
Feedback Score: 0 reviews
i just started c++ this year too...im a senior in high school....i hope its not to hard
aqwkmf is offline   Reply With Quote
Old 09-29-2002, 09:39 PM   #8
SimpleS14
Post Whore!
 
SimpleS14's Avatar
 
Join Date: Feb 2002
Location: Philly
Age: 42
Posts: 9,185
Trader Rating: (0)
SimpleS14 is close to perfectionSimpleS14 is close to perfectionSimpleS14 is close to perfectionSimpleS14 is close to perfectionSimpleS14 is close to perfectionSimpleS14 is close to perfectionSimpleS14 is close to perfectionSimpleS14 is close to perfectionSimpleS14 is close to perfectionSimpleS14 is close to perfectionSimpleS14 is close to perfection
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.
SimpleS14 is offline   Reply With Quote
Old 09-29-2002, 09:41 PM   #9
Kreator
Nissanaholic!
 
Kreator's Avatar
 
Join Date: Mar 2002
Location: MD
Age: 41
Posts: 1,975
Trader Rating: (0)
Kreator will become famous soon enoughKreator will become famous soon enoughKreator will become famous soon enough
Feedback Score: 0 reviews
</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=''> that's when the real pita starts.
__________________


кто болеет за Зенит, у того всегда стоит!
Kreator is offline   Reply With Quote
Old 10-02-2002, 05:47 AM   #10
silvia S13
 
Join Date: Aug 2002
Posts: 41
Trader Rating: (0)
silvia S13 is an unknown quantity at this point
Feedback Score: 0 reviews
</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. &nbsp;I regret coming here. &nbsp;It's a geek school. &nbsp;What bout you guys? &nbsp;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.
silvia S13 is offline   Reply With Quote
Old 10-02-2002, 10:11 AM   #11
Kreator
Nissanaholic!
 
Kreator's Avatar
 
Join Date: Mar 2002
Location: MD
Age: 41
Posts: 1,975
Trader Rating: (0)
Kreator will become famous soon enoughKreator will become famous soon enoughKreator will become famous soon enough
Feedback Score: 0 reviews
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=''>
__________________


кто болеет за Зенит, у того всегда стоит!
Kreator is offline   Reply With Quote
Reply

Bookmarks



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 03:44 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vB.Sponsors
Copyright ? 1998 - 2022, Zilvia.net