Go Back   Flash Flash Revolution > General Discussion > Chit Chat
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
Old 10-7-2005, 03:06 PM   #41
talisman
Resident Penguin
FFR Simfile AuthorFFR Veteran
 
talisman's Avatar
 
Join Date: May 2003
Age: 37
Posts: 4,598
Send a message via AIM to talisman
Default RE: Re: RE: Re: RE: Re: C++ Help

main () isn't even a function... I thought you had to say int main(); which means it has to return an integer. Could be wrong about that.
talisman is offline   Reply With Quote
Old 10-7-2005, 03:10 PM   #42
QreepyBORIS
FFR Player
 
QreepyBORIS's Avatar
 
Join Date: Feb 2003
Location: It is a mystery.
Age: 33
Posts: 7,454
Send a message via AIM to QreepyBORIS Send a message via MSN to QreepyBORIS
Default RE: Re: RE: Re: RE: Re: C++ Help

You can do void main with some compliers only. But you did not specify a data type for main...what were you thinking? :P
__________________

Signature subject to change.

THE ZERRRRRG.
QreepyBORIS is offline   Reply With Quote
Old 10-7-2005, 03:50 PM   #43
GuidoHunter
is against custom titles
Retired StaffFFR Veteran
 
GuidoHunter's Avatar
 
Join Date: Oct 2003
Location: Texas
Age: 39
Posts: 7,371
Send a message via AIM to GuidoHunter Send a message via Skype™ to GuidoHunter
Default RE: Re: RE: Re: RE: Re: C++ Help

I know from experience that the compiler Jurs is using will accept void main() and that you need a function type in front of it.

Also, chicken, I'm still not sure of thes, but I would have written the conditional lines like:

if ((y==0) && (x==0)

I do that just to be safe, but again, I'm not sure exactly which parentheses are actually necessary (although I'm rather certain the outside ones are.

--Guido

http://andy.mikee385.com
__________________

Quote:
Originally Posted by Grandiagod View Post
Quote:
Originally Posted by Grandiagod View Post
She has an asshole, in other pics you can see a diaper taped to her dead twin's back.
Sentences I thought I never would have to type.
GuidoHunter is offline   Reply With Quote
Old 10-7-2005, 05:56 PM   #44
JurseyRider734
lil j the bad b-word
Retired StaffFFR Veteran
 
JurseyRider734's Avatar
 
Join Date: Aug 2003
Location: nj
Age: 33
Posts: 7,506
Send a message via AIM to JurseyRider734 Send a message via Skype™ to JurseyRider734
Default RE: Re: RE: Re: RE: Re: C++ Help

Thank you guys <333 I finished.

I got an 83 though because my teacher hates me (from last year) and I finished a day later.
__________________
Quote:
Originally Posted by Arch0wl
I'd better be considering I own roughly six textbooks on logic and have taken courses involving its extensive use

Quote:
Originally Posted by Afrobean View Post
Quote:
Originally Posted by JurseyRider734
the fact that you're resorting to threatening physical violence says a lot anyway.
Just that you're a piece of shit who can't see reason and instead deserves a fucking beating.
JurseyRider734 is offline   Reply With Quote
Old 10-7-2005, 06:03 PM   #45
soccr743
FFR Player
Retired Staff
 
soccr743's Avatar
 
Join Date: Dec 2003
Posts: 549
Send a message via AIM to soccr743 Send a message via MSN to soccr743 Send a message via Yahoo to soccr743
Default Re: RE: Re: RE: Re: RE: Re: C++ Help

Quote:
Originally Posted by GuidoHunter
if ((y==0) && (x==0)

I do that just to be safe, but again, I'm not sure exactly which parentheses are actually necessary (although I'm rather certain the outside ones are.
Yea, you can use as many as you want, but the easiest way:

if (y == 0 && x==0)
{
}

The inside ones are not necessary.

-----Soccr743-----
__________________
soccr743 is offline   Reply With Quote
Old 10-8-2005, 09:16 AM   #46
chickendude
Away from Computer
FFR Simfile AuthorFFR Veteran
 
chickendude's Avatar
 
Join Date: Sep 2003
Location: Massachusetts
Age: 33
Posts: 1,901
Send a message via AIM to chickendude
Default RE: Re: RE: Re: RE: Re: RE: Re: C++ Help

I've never used int main or void main and it worked with my compiler

eh whatever, I'll start using it now just to be safe.
__________________
chickendude is offline   Reply With Quote
Old 10-8-2005, 09:43 AM   #47
soccr743
FFR Player
Retired Staff
 
soccr743's Avatar
 
Join Date: Dec 2003
Posts: 549
Send a message via AIM to soccr743 Send a message via MSN to soccr743 Send a message via Yahoo to soccr743
Default RE: Re: RE: Re: RE: Re: RE: Re: C++ Help

Chickendude, saying "main() { }" is like saying "void main() { }".

-----Soccr743-----
__________________
soccr743 is offline   Reply With Quote
Old 10-8-2005, 12:32 PM   #48
ad0gg
FFR Player
 
Join Date: Dec 2003
Location: At My House
Posts: 989
Default RE: Re: RE: Re: RE: Re: RE: Re: C++ Help

It is a good habit to use "int main() {}" because you can control where you want your program to end (unless of course you have some legitimate reason why you wouldn't want to control where you stop the program).
__________________
ad0gg is offline   Reply With Quote
Old 10-8-2005, 03:12 PM   #49
chickendude
Away from Computer
FFR Simfile AuthorFFR Veteran
 
chickendude's Avatar
 
Join Date: Sep 2003
Location: Massachusetts
Age: 33
Posts: 1,901
Send a message via AIM to chickendude
Default RE: Re: RE: Re: RE: Re: RE: Re: C++ Help

wait, does a function automatically end when something is returned?
__________________
chickendude is offline   Reply With Quote
Old 10-8-2005, 03:23 PM   #50
ad0gg
FFR Player
 
Join Date: Dec 2003
Location: At My House
Posts: 989
Default Re: RE: Re: RE: Re: RE: Re: RE: Re: C++ Help

Quote:
Originally Posted by chickendude
wait, does a function automatically end when something is returned?
Yes.
__________________
ad0gg is offline   Reply With Quote
Old 11-14-2005, 07:05 PM   #51
Necamus
FFR Player
 
Necamus's Avatar
 
Join Date: Nov 2005
Age: 34
Posts: 853
Default RE: Re: RE: Re: RE: Re: RE: Re: RE: Re: C++ Help

I would have to say using int main() is a great habit to get into. And a lot of the nuances (I think that is a word) of the code have to do with the compiler. I use Microsoft Visual C++ .Net. Pretty good, but it doesn't seem to like string variables.

http://www.cpp-home.com/forum/index.php?c=2
This is a good forum to go to for all your coding help.
__________________
www.freerice.com
Necamus is offline   Reply With Quote
Old 11-14-2005, 07:23 PM   #52
ad0gg
FFR Player
 
Join Date: Dec 2003
Location: At My House
Posts: 989
Default ad0gg is awesome!

Quote:
Originally Posted by Necamus
I use Microsoft Visual C++ .Net. Pretty good, but it doesn't seem to like string variables.
Are you using the actual "string" variable type (with the header string.h) or are you using character arrays? I find that character arrays, while a little more difficult to use, give you greater control over what you want to do. However, if you don't really need to do much with the string, type "string" is easier. But I still almost always use character arrays anyways.
__________________
ad0gg is offline   Reply With Quote
Old 11-14-2005, 07:42 PM   #53
soccr743
FFR Player
Retired Staff
 
soccr743's Avatar
 
Join Date: Dec 2003
Posts: 549
Send a message via AIM to soccr743 Send a message via MSN to soccr743 Send a message via Yahoo to soccr743
Default RE: ad0gg is awesome!

I didnt like the string class provided, so I built my own. Its not that hard and it is worth it. While you are at it, you should also do a List<type> class for a better array thing, Dictionary<keytype, valuetype> for a lookup. (Those latter classes use templating which is a useful thing to know).

-----Soccr743-----
__________________
soccr743 is offline   Reply With Quote
Old 11-15-2005, 01:09 PM   #54
Necamus
FFR Player
 
Necamus's Avatar
 
Join Date: Nov 2005
Age: 34
Posts: 853
Default Re: ad0gg is awesome!

Quote:
Originally Posted by ad0gg
Quote:
Originally Posted by Necamus
I use Microsoft Visual C++ .Net. Pretty good, but it doesn't seem to like string variables.
Are you using the actual "string" variable type (with the header string.h) or are you using character arrays? I find that character arrays, while a little more difficult to use, give you greater control over what you want to do. However, if you don't really need to do much with the string, type "string" is easier. But I still almost always use character arrays anyways.
I can't remember what I was using...I tried it a few months ago, it didn't work, and I haven't found a need to use strings since.
__________________
www.freerice.com
Necamus is offline   Reply With Quote
Old 11-20-2005, 04:17 PM   #55
zajac
aka uAnimals
FFR Music Producer
 
zajac's Avatar
 
Join Date: Aug 2003
Location: Soundcloud.com/uAnimals
Age: 37
Posts: 4,050
Send a message via MSN to zajac
Default RE: C++ Help

You could probably do it easier, and much more graphically presentable if you do it in Flash... I could probably whip something up for you in about half an hour... But since I'm too lazy to read the posts... I'm sure someone did this for you already anyways...
__________________
Quote:
Originally Posted by Spec & Aperson
We Rate You: Cool Motherfucer. 9/10
zajac is offline   Reply With Quote
Old 11-21-2005, 11:16 AM   #56
igotrhythm
Fractals!
FFR Veteran
 
igotrhythm's Avatar
 
Join Date: Sep 2004
Location: Meesheegan
Age: 38
Posts: 6,534
Send a message via Skype™ to igotrhythm
Default RE: C++ Help

I think the logic behind the int main() function where everything else goes is that the main function is supposed to return 0 if the program runs according to plan. More robust programs would include nonzero return values for the main program depending on where a certain kind of problem cropped up.

Getting back to the original question on page 1 (even though I know it's kind of a moot point), you could just enter the price of the item, declare the markup and tax variables as functions of the price of the item, then output the item's price, the markup, and the tax, then the final total by summing them. If my logic holds, you could even enter negative values for the markup to indicate that the item is discounted. And if the logic doesn't hold, at least it's a good test case.

Edit: I'm pretty good with algorithms, but I suck at coding. <_<
__________________
Quote:
Originally Posted by thesunfan View Post
I literally spent 10 minutes in the library looking for the TWG forum on Smogon and couldn't find it what the fuck is this witchcraft IGR
igotrhythm is offline   Reply With Quote
Old 02-3-2006, 08:55 AM   #57
SpoOkyMagician
Forum User
FFR Veteran
 
Join Date: May 2004
Posts: 378
Default RE: Re: RE: Re: RE: Re: RE: Re: C++ Help

Quote:
Junior year of high school. In my C++ class, we would go to addictinggames and follow links when we were done with our programming project.

I clicked a link called "Flash Flash Revolution" once, on a whim...

...and here I am.
Whoa... You have a course on C++ in high school? What kind of school do you go to? In high school here, we wouldn't learn something like C++... in college we would; but High School? But however... On my senior project, i am trying game design with C++; and so far... I think i'm gonna fail... I understand some of it already since I make games with another program i use. Although, its not C++. it just has some things in it such as if, or, else, and whatnot... (Which i do understand...) it's just all the keywords in the language and stuff that i don't understand...

BTW by the time i read your responce, I should do my project. I don't have internet at home right now and I can't use the school's internet too often unless its for school work. right now, i have freetime... (which is rare here...) So if you do respond... I won't be able to read it for awhile... which really sucks... (I guess i'll come by later... bye.)
SpoOkyMagician is offline   Reply With Quote
Old 02-10-2006, 07:39 PM   #58
Evilcatt09
FFR Player
 
Join Date: Feb 2006
Posts: 3
Default RE: Re: RE: Re: RE: Re: RE: Re: C++ Help

my high school has a C++ course and an AP Comp Science(Java) course and next year they are adding an honors java course to replace the C++ course, but my school is a magnet school for math,science,and technology so I guess thats why we have all that
Evilcatt09 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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 -5. The time now is 11:14 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright FlashFlashRevolution