QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Consumer > General PC Forums > Everything Windows
The above video goes away if you are a member and logged in, so log in now!

Help a noob in C++

This is a discussion on Help a noob in C++ within the Everything Windows forums, part of the General PC Forums category; After many delays...i'm finally learning C++...the book i'm reading is great, and it's been a smooth ride so far, but ...

Reply
 
LinkBack Thread Tools
Old 04-15-2008, 07:08 PM   #1
 
Join Date: Apr 2006
Posts: 0
Trader Feedback: 0
Default Help a noob in C++

After many delays...i'm finally learning C++...the book i'm reading is great, and it's been a smooth ride so far, but there is one thing I haven't been able to understand: How to call a function!

I just don't understand it the way the show it in the book. Like in one example they write a program that finds triangle numbers, and a certain function does this...here is how they call it:
Quote:
cout << "Function returned" << triangle(4);
(here 4 is the integer used)

In another example they write a program that determines if a number is prime or not...here is how they call the function used:
Quote:
if (prime(i))
I understand how to declare a function, and how to define one, but not how to call it.

btw im using Visuall C++ 2005 if that is needed.
Frenchb0ygenius is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-16-2008, 01:01 AM   #2
 
Mister Chief's Avatar
 
Join Date: Jul 2005
Location: Bungie Studios
Posts: 7,832
Trader Feedback: 0
Default

FunctionName( any variables you're sending to the function );
__________________
[CENTER][IMG]http://i169.photobucket.com/albums/u240/Murasaki007/3060000000056603.gif[/IMG][COLOR=Lime]

[/COLOR][CENTER]
[/CENTER]
[URL="http://forums.qj.net/showthread.php?t=111647"]All Forum Policies[/URL] [/CENTER]
[CENTER]
[/CENTER]
Mister Chief is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-16-2008, 03:55 AM   #3
 
FreePlay's Avatar
 
Join Date: Dec 2005
Location: h0000000rj
Posts: 12,858
Trader Feedback: 0
Default

I'm trying to figure out what you don't understand. You know how to declare a function, and you've seen their examples of calling functions... what is left?
__________________
[qj now fails.]
FreePlay is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-16-2008, 07:14 AM   #4
 
Join Date: Apr 2006
Posts: 0
Trader Feedback: 0
Default

Well, i guess since when they showed how to name a function they gave a certain format: type name_of_function(argument s), and they did for a lot of stuff like casting, loops, etc...i was just a little lost. Thanks Mister.
Frenchb0ygenius is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
noob

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 03:28 PM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2009, QJ.NET. All Rights Reserved.
Contact Us