Post: [C++] Typedef Tut [C++]
01-23-2011, 09:25 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); What Typedef Does?
Typedef is a perfect way to shorten words in c++ .

How To use it

    typedef nameofwhatyourshortening thenewname;

E,g

    typedef unsigned short int Ushort;

E,g In a Program

    #include <iostream>
using namespace std;
//Shorting unsigned int to Ushort with a global scope
typedef unsigned short int Ushort;
int main()
{
Ushort num1;
cout << "Typedef Does work Proof : /nType a number"<<endl;
cin >>num1;
cout << "The Number you typed = << num1 <<endl;
system("pause");
return 0;
}

This is a very good way to shorten words .
01-23-2011, 10:11 PM #2
bmxdude9
Million Miles Of Fun!
Yeah for some variables it makes things easier but I usually used define, or I think I did.
01-23-2011, 10:14 PM #3
3arc
Meow.
good tut, however, your code is /really/ messy.
01-23-2011, 10:16 PM #4
Girby2K11
☮ ☯ ☢ ✔ ➝
by the way you shouldnt use system("PAUSE"); search it up, use cin.get();
01-24-2011, 05:08 PM #5
Cyborg Ninja
PS3 Security FtW !
Originally posted by Girby2K11 View Post
by the way you shouldnt use system("PAUSE"); search it up, use cin.get();

Yeah i know but for some people who are just beginners thats something they will understand .
01-24-2011, 09:27 PM #6
Girby2K11
☮ ☯ ☢ ✔ ➝
Originally posted by packarda12 View Post
Yeah i know but for some people who are just beginners thats something they will understand .


lol i must not be a begginer then i sstarted programming about 2 months ago and i know quite a lot got any tips Winky Winky

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo