You are viewing our Forum Archives. To view or take place in current topics click here.
#31. Posted:
-Charizard-
  • Prospect
Status: Offline
Joined: Jan 20, 201113Year Member
Posts: 660
Reputation Power: 29
Status: Offline
Joined: Jan 20, 201113Year Member
Posts: 660
Reputation Power: 29
thanks ur the best/////////////////
#32. Posted:
Team_Exodus
  • New Member
Status: Offline
Joined: Aug 14, 201113Year Member
Posts: 40
Reputation Power: 1
Status: Offline
Joined: Aug 14, 201113Year Member
Posts: 40
Reputation Power: 1
Good tutorial! Nice work
#33. Posted:
KingModz
  • TTG Senior
Status: Offline
Joined: Jul 26, 201113Year Member
Posts: 1,573
Reputation Power: 80
Status: Offline
Joined: Jul 26, 201113Year Member
Posts: 1,573
Reputation Power: 80
ok im am going to study the shit out of this

i really want to use this post so i can start to code mod menus
#34. Posted:
cliccme
  • New Member
Status: Offline
Joined: Nov 29, 201113Year Member
Posts: 1
Reputation Power: 0
Status: Offline
Joined: Nov 29, 201113Year Member
Posts: 1
Reputation Power: 0
You know friend,
this is really helpful for me and my whole class.
There is sixty students in my class included me. I am in university.
Thank You very much.
#35. Posted:
Lucario-
  • TTG Addict
Status: Offline
Joined: Aug 21, 201113Year Member
Posts: 2,673
Reputation Power: 112
Status: Offline
Joined: Aug 21, 201113Year Member
Posts: 2,673
Reputation Power: 112
Hey, what is the best program to be using this for?
Don't flame or troll, I just want to learn how.
#36. Posted:
KingModz
  • TTG Senior
Status: Offline
Joined: Jul 26, 201113Year Member
Posts: 1,573
Reputation Power: 80
Status: Offline
Joined: Jul 26, 201113Year Member
Posts: 1,573
Reputation Power: 80
This is a Real Nice Tutorial, Thanks
#37. Posted:
Matttm
  • New Member
Status: Offline
Joined: Aug 07, 200915Year Member
Posts: 32
Reputation Power: 1
Status: Offline
Joined: Aug 07, 200915Year Member
Posts: 32
Reputation Power: 1
nice, thx man

I dont understands the writing functions part fully though
#38. Posted:
RDCA
  • TTG Contender
Status: Offline
Joined: Jul 12, 201014Year Member
Posts: 3,612
Reputation Power: 173
Status: Offline
Joined: Jul 12, 201014Year Member
Posts: 3,612
Reputation Power: 173
Matttm wrote nice, thx man

I dont understands the writing functions part fully though


Basically it is a section of code, which is like 'main()' but it is separate and must be called in order to run, and this call must provide the needed arguments for the function. Also if this function follows after main, you must declare a Prototype for it. So in Skatertg's function tutorial there is three main things to note.

So here in the entire thing:
#include <iostream>
   
  /* Prototype Declarations */
   int addition(int x, int y); // Addition accepts two arguments of type integer.
   
  int main() // Return value of type integer.
  {
    int result, x, y;
   
    std::cout << Enter integer 1: ;
     std::cin >> x;
    std::cout << \n << Enter integer 2: ;
    std::cin >> y;
 
    result = addition(x, y); // Pass the return value of addition to result.
     
    std::cout << x << + << y << = << result << std::endl;
  }
   
  int addition(int x, int y)
  {
    return x + y;
  }
 


Now we can break that up into 3 main things, the Main(), the addition class, and addition's prototype since it is placed below the Main().

addition's prototype:
int addition(int x, int y);

int addition(int x, int y);
Blue = the data type of what the function returns
red = the function name
Violet = Two different arguments, with their data types and the variables they are assigned to respectively.

main:
This is just the main code that is executed running the file. The important thing to notice in here is the call which is made to the function addition.

result = addition(x, y);

Here we see, the variable result being assigned the returned integer value of addition.

addition:
Here we see the function addition, which takes two arguments, x and y. So you can pass these arguments as any integer you want, well to a certain extent as certain numbers are to big, have decimals, or are negative so they aren't int's.


Also remember a couple things, capitalization counts,not all numbers are the same, and don't forget to declare your prototypes.
#39. Posted:
skatertg
  • Blind Luck
Status: Offline
Joined: Jan 20, 201014Year Member
Posts: 8,013
Reputation Power: 2165
Status: Offline
Joined: Jan 20, 201014Year Member
Posts: 8,013
Reputation Power: 2165
Updated with a very resourceful E-book which goes into the world of C++ in detail.
#40. Posted:
RDCA
  • TTG Contender
Status: Offline
Joined: Jul 12, 201014Year Member
Posts: 3,612
Reputation Power: 173
Status: Offline
Joined: Jul 12, 201014Year Member
Posts: 3,612
Reputation Power: 173
In addition to the EBooks skater has, here is my collection I picked up from miscellaneous websites. My favorite and probably most helpful would be "Accelerated C++ Practical Programming" as it does tend to learn more towards people who already have a sturdy base in other languages. Though newcomers can learn from it, they may also want to try out "Sam's Teach yourself C++ in 21 Days". There are some other goodies in there as well, including game programming and networking.

[ Register or Signin to view external links. ]
Hope you guys enjoy.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.