Geekpedia Tutorials Home

Building a C# Chat Client and Server

Building a C# Chat Client and ServerA step by step tutorial teaching you how to create your own chat client and chat server easily in C#, for local networks or the Internet.

in C# Programming Tutorials

Getting Hard Drive Information

Getting Hard Drive InformationA C# tutorial showing you how to make use of WMI to extract information on disk drives, such as model, capacity, sectors and serial number.

in C# Programming Tutorials

UPS Shipping Calculator

UPS Shipping CalculatorThis tutorial will teach you how to calculate the shipping cost based on the weight, height, length and depth of the box, the distance and the UPS service type.

in PHP Programming Tutorials

Create Your Own Rich Text Editor

Create Your Own Rich Text EditorCreating a Rich Text Editor using JavaScript is easier to do than you might think, thanks to the support of modern browsers; this tutorial will walk you through it.

in JavaScript Programming Tutorials
Search
Tutorials
Programming Tutorials
IT Jobs
From CareerBuilder

Understanding C++ data types I

A small book for those beginners in C++ or even in programming who didn’t understand C++ data types. This is meant to be a patch to other books, that cover the basics of C++. Data types can be a little tricky sometimes, and difficult to understand, this book explains how data types work, and also shows you how to use them by giving examples.

On Monday, March 1st 2004 at 09:09 PM
By Andrew Pociu (View Profile)
***--   (Rated 3.1 with 11 votes)
Contextual Ads
More C++ Resources
Advertisement

Introduction



Book’s purpose

This is a short book for those beginners in C++ or even in programming who didn’t understand data types in C++. This book will only cover the C++ own types and will not teach you how you can create your own data types. There will be examples of how you should use data types and how you shouldn’t. This book is divided in separate parts, this is part 1. It will teach you C++ integers. Float will be covered in part 2 of this book.

What you should know

This book is for those who know the basics of C++. You can still learn data types from this book without knowing the basics of C++, but I recommend you to read a complete book first, and then, when you reach the data types lesson in that book, and after you read it, you read this short book too, to be sure you completely understand data types.

What you should have

I’m using Microsoft Windows XP as the operating system, and that means that this book applies only to Windows users, because data types differ in other operating systems like UNIX or Mac OS.
You must have a compiler of course, and in this book, we use Visual C++ 6 Enterprise Edition. It makes a difference which compiler you are using, because data types often differ from one compiler to the other.



What data types are


Data types

Many programming languages use different data types. This data types can hold different values. There are some data types that can hold small values, and use less memory, and there are data types that can hold bigger values, but use much more memory.


Adequate data type for adequate value
There is no reason for you to store a small value in a big data type, because the space that it occupies in the computer memory is wasted.
Let’s suppose you have a five characters word, like ‘aloha’, and the smallest data types you have can hold one character, five, or ten. Which should you use? Of course, if you can’t use the data type that holds one character because it has room to store only the first character, ‘a’. You can use the data type that holds ten characters, and the situation would look like this:





Not very clever. You’re wasting five additional characters. The five characters that will remain empty will be reserved, because you declared 10 characters to be used. Therefore, the remaining 5 empty spaces cannot be used by another instance of a data type. It’s reserved for this data type instance only. On the other side, you can expand the word later, if you wish, to a maximum of 10 characters. For example, you can write ‘alohaaaa!’ and fill all the empty spaces.
However, if you know this value doesn’t change why should you use the ten characters data type and not the five characters one?





You save memory space and at the same time, your program gains performance.

This was only an example to demonstrate you why data types are important. This is not a real-life example from C++. In the next lessons, we will work with more real-life examples.


Now you can read 'Understanding C++ data types II'
Digg Digg It!     Del.icio.us Del.icio.us     Reddit Reddit     StumbleUpon StumbleIt     Newsvine Newsvine     Furl Furl     BlinkList BlinkList

Rate Rate this tutorial
Comment Current Comments
by amna on Thursday, April 15th 2004 at 07:56 PM

i wwant to know abt some complete basic,and abt some programming.


regrads
Amna

by Andrei Pociu on Thursday, April 15th 2004 at 08:22 PM

Then try this:
http://www.geekpedia.com/prog_ttrls.php?id=11
http://www.geekpedia.com/prog_ttrls.php?id=12
http://www.geekpedia.com/prog_ttrls.php?id=13

by amir on Friday, May 28th 2004 at 10:08 PM

parallel port programing

by nassim on Friday, May 6th 2005 at 09:11 AM

hi
i want to know how to program th parallel port using

c++ version 5.02 ?
i tryed the c programs but the compiler gives me major
error. please explaine why.
thank you.

by rupesh tiwari on Thursday, July 7th 2005 at 09:17 AM

i want to write a program in c language for transfering data from one computer to another computer using parallel port in printer port.

by Octavia on Sunday, October 9th 2005 at 03:11 PM

I want to write a program in C++ that reads data from a file whose name is input by the user, and that outputs the first word following each of the first three comma in the file.

by me on Monday, March 13th 2006 at 02:38 PM

me too

by rajat on Tuesday, March 28th 2006 at 12:54 PM

i want to know about datastuructures in c/c++

by Innocent J on Saturday, April 8th 2006 at 08:07 PM

Seems like a great book, i hope I will like it!

by vijay sharma on Friday, April 14th 2006 at 10:56 AM

hello
i want to learn how to programing for port programing using 'c' language.

by Jone on Sunday, July 23rd 2006 at 04:15 AM

Hi anyone, i'd really love to learn programming but i dont have the essential tutorial notes and the appropriate software, anyone willing to help with good heart...?

by N26 on Saturday, January 19th 2008 at 05:38 PM

why are u muppets posting under data types? Parallel Port programming (is that for ur robot arm demo) should be under device slash hardware-interface programming... crickey!

PS. btw this first page of data-types is not well written, it\'s not that i don\'t appreciate the hard-work, but still.

by foo on Saturday, June 21st 2008 at 05:33 AM

Sorry just had to learn how to do this

by foo on Saturday, June 21st 2008 at 05:33 AM

Sorry just had to learn how to do this

by sultan Mohammad on Tuesday, July 7th 2009 at 12:39 AM

i need information about Differend type of data in C

by allyn on Wednesday, November 10th 2010 at 09:46 AM

HI! can someone please help me in creating a program that deals with encryption algorithm. how to create program that uses substitution ciphers, transportation ciphers and insertion ciphers. please give the code please use the c language. thanks alot!

by allyn on Wednesday, November 10th 2010 at 09:46 AM

HI! can someone please help me in creating a program that deals with encryption algorithm. how to create program that uses substitution ciphers, transportation ciphers and insertion ciphers. please give the code please use the c language. thanks alot!

by saifi farooqui on Friday, February 25th 2011 at 09:48 AM

i want to write a program in c that can understand the verbal commands and perform function according to the commands.

by online stories on Sunday, August 14th 2011 at 06:09 AM

I am really not too inferior with this dominate but I do change to shift blogs for layout ideas. You noise dilated upon a attribute that I ordinarily don't mending often around and prefabricated it rale sexy. This is a best blog that I module dress comment of. I already bookmarked it for arrival indicator.Thank you

by happy ramadan wishes on Monday, August 15th 2011 at 05:09 AM

am really not too inferior with this dominate but I do change to shift blogs for layout ideas. You noise dilated upon a attribute that I ordinarily don't mending often around and prefabricated it rale sexy. This is a best blog that I module dress comment of. I already bookmarked it for arrival indicator.Thank you

by heartburn causes on Friday, August 19th 2011 at 09:13 PM


Pretty unliterary sum. I pianoforte stumbled upon your ledger and hot to say that I possess study enjoyed entity your aggregation posts. Any way I'll be subscribing to your cater and I draftsmanship you publicise again presently

by Facebook Status on Monday, September 26th 2011 at 12:25 AM

After reading the article, I feel that I need more information on the topic. Can you suggest some resources please?, Excellent post!

by the offshore company on Saturday, October 8th 2011 at 02:02 AM


Temporary nicely scrivened fundament it contains interoperable entropy for me. I am timekeeper to lot your whining way of run the ontogeny. Now you add it atoxic for me to see and obligate the intention. Interact you for the analeptic.

<a href="http://www.offshoreletter.com/how-to-form-an-offshore-company/">the offshore company </a>

by onshore offshore on Saturday, October 8th 2011 at 11:33 PM

Your journal is so municipality that every one would undergo pleasure to valuation comments. So am I. Thanks.

by exe file extension on Thursday, November 17th 2011 at 08:33 AM

Great tutorial, Andrew! I have one question though: why double is treated as distinct data type in C ? I mean why should it not be a distinct data type? I skimmed through many sites and wasn't able to find a correct answer for this question. Can anyone clear this up for me please?

by replica Tag Heuer Watches on Monday, November 21st 2011 at 12:45 AM

Great information once again! I am looking forward for your next post

by soles shoes on Friday, November 25th 2011 at 08:04 PM

I am really satisfied with this posting that you have given us. This is really a stupendous work done by you. Thank you and looking for more posts.

by lace flower girl dresses on Friday, November 25th 2011 at 08:05 PM

Henry Kissinger~ The great tragedies of history occur not when right confronts wrong but when two rights confront each other.

by magazine subscription deals on Thursday, December 8th 2011 at 10:18 AM

i want to know the sql quary for retriveing, deleting and count duplicate data from a table. The information and the detail were just perfect. I think that your perspective is deep, its just well thought out and really fantastic to see someone who knows how to put these thoughts down so wel Nice post.Thank you for taking the time to publish this information very useful!I’m still waiting for some interesting thoughts from your side in your next post thanks

by Contextual Links on Thursday, December 8th 2011 at 10:33 AM

Win you for author nonsynthetic article. Where encourage could anyone get that category of group in ofttimes a sum way of utilise ? I conversation a rely raddled connect, and I am on the spotter for quantity forgather. and you can use the GDI library for that. There are some examples on this website on how to use it to write text to a graphic, and many others on the web.

by file extension software on Monday, December 19th 2011 at 07:53 AM

I never had big problems learning data types in C because they were almost identical to the ones I used in C. As a side note the actual transition to C# was easy as well. It's the base... once you get some solid things they stick forever... no matter the programming language.

by columbus garage doors on Wednesday, December 21st 2011 at 09:04 AM

I think we need to bring more ideas for this purpose. Involvement of young people can be handy in this regard. I am happy to find a good post here.

by Roch on Tuesday, January 24th 2012 at 06:53 AM

Once you have recreated the problem and captured these steps, you can save them to a file and send it to your support person, who can then open it up and view

by free ringtones for virgin mobile on Sunday, January 29th 2012 at 03:19 PM

I have read and will be added to my personal knowledge... thanks

by free ringtones for virgin mobile on Sunday, January 29th 2012 at 03:20 PM

I have read and will be added to my personal knowledge... thanks

by mamta devi on Thursday, February 2nd 2012 at 09:26 PM

#include"graphics.h"
#include"stdlib.h"
#include"math.h"
#include"stdio.h"
#include"stdarg.h"
#include"conio.h"
#include"string.h"
/*constant definition*/
#define PI 3.14159
#define NUME 30
#define DENOM 100
#define NUMBER 7
#define RAD 2.0
#define DTHETA 0.1
#define REDUX 3
#define SEGS 60
#define MIN 1
#define NFONTS 11
/* function prototypes */
void main();
void initgraph (void);
void tdisplay(int,float,int,int,int);
void cdisply(int,int,int);
void bucket(void);
/* global variables */
int gd=DETECT,gm;
int graphdriver,graphmode,maxcolors,errorcode,grok;
int xo,yo,maxx,maxy,xasp,yasp;
double aspectratio;
void initgrasph(void)
{
int gd=DETECT,gm;
if(errorcode!=grok){
printf("unable to register EGAVGA driver");
exit(1);
}
if(errorcode!=grOk)
{
printf("unable to register TRIPLEX font");
exit(1);
}
initgraph(

by mamta devi on Thursday, February 2nd 2012 at 09:26 PM

#include"graphics.h"
#include"stdlib.h"
#include"math.h"
#include"stdio.h"
#include"stdarg.h"
#include"conio.h"
#include"string.h"
/*constant definition*/
#define PI 3.14159
#define NUME 30
#define DENOM 100
#define NUMBER 7
#define RAD 2.0
#define DTHETA 0.1
#define REDUX 3
#define SEGS 60
#define MIN 1
#define NFONTS 11
/* function prototypes */
void main();
void initgraph (void);
void tdisplay(int,float,int,int,int);
void cdisply(int,int,int);
void bucket(void);
/* global variables */
int gd=DETECT,gm;
int graphdriver,graphmode,maxcolors,errorcode,grok;
int xo,yo,maxx,maxy,xasp,yasp;
double aspectratio;
void initgrasph(void)
{
int gd=DETECT,gm;
if(errorcode!=grok){
printf("unable to register EGAVGA driver");
exit(1);
}
if(errorcode!=grOk)
{
printf("unable to register TRIPLEX font");
exit(1);
}
initgraph(

by mamta devi on Thursday, February 2nd 2012 at 09:26 PM

#include"graphics.h"
#include"stdlib.h"
#include"math.h"
#include"stdio.h"
#include"stdarg.h"
#include"conio.h"
#include"string.h"
/*constant definition*/
#define PI 3.14159
#define NUME 30
#define DENOM 100
#define NUMBER 7
#define RAD 2.0
#define DTHETA 0.1
#define REDUX 3
#define SEGS 60
#define MIN 1
#define NFONTS 11
/* function prototypes */
void main();
void initgraph (void);
void tdisplay(int,float,int,int,int);
void cdisply(int,int,int);
void bucket(void);
/* global variables */
int gd=DETECT,gm;
int graphdriver,graphmode,maxcolors,errorcode,grok;
int xo,yo,maxx,maxy,xasp,yasp;
double aspectratio;
void initgrasph(void)
{
int gd=DETECT,gm;
if(errorcode!=grok){
printf("unable to register EGAVGA driver");
exit(1);
}
if(errorcode!=grOk)
{
printf("unable to register TRIPLEX font");
exit(1);
}
initgraph(

by mamta devi on Thursday, February 2nd 2012 at 09:26 PM

#include"graphics.h"
#include"stdlib.h"
#include"math.h"
#include"stdio.h"
#include"stdarg.h"
#include"conio.h"
#include"string.h"
/*constant definition*/
#define PI 3.14159
#define NUME 30
#define DENOM 100
#define NUMBER 7
#define RAD 2.0
#define DTHETA 0.1
#define REDUX 3
#define SEGS 60
#define MIN 1
#define NFONTS 11
/* function prototypes */
void main();
void initgraph (void);
void tdisplay(int,float,int,int,int);
void cdisply(int,int,int);
void bucket(void);
/* global variables */
int gd=DETECT,gm;
int graphdriver,graphmode,maxcolors,errorcode,grok;
int xo,yo,maxx,maxy,xasp,yasp;
double aspectratio;
void initgrasph(void)
{
int gd=DETECT,gm;
if(errorcode!=grok){
printf("unable to register EGAVGA driver");
exit(1);
}
if(errorcode!=grOk)
{
printf("unable to register TRIPLEX font");
exit(1);
}
initgraph(

by mamta devi on Thursday, February 2nd 2012 at 09:26 PM

#include"graphics.h"
#include"stdlib.h"
#include"math.h"
#include"stdio.h"
#include"stdarg.h"
#include"conio.h"
#include"string.h"
/*constant definition*/
#define PI 3.14159
#define NUME 30
#define DENOM 100
#define NUMBER 7
#define RAD 2.0
#define DTHETA 0.1
#define REDUX 3
#define SEGS 60
#define MIN 1
#define NFONTS 11
/* function prototypes */
void main();
void initgraph (void);
void tdisplay(int,float,int,int,int);
void cdisply(int,int,int);
void bucket(void);
/* global variables */
int gd=DETECT,gm;
int graphdriver,graphmode,maxcolors,errorcode,grok;
int xo,yo,maxx,maxy,xasp,yasp;
double aspectratio;
void initgrasph(void)
{
int gd=DETECT,gm;
if(errorcode!=grok){
printf("unable to register EGAVGA driver");
exit(1);
}
if(errorcode!=grOk)
{
printf("unable to register TRIPLEX font");
exit(1);
}
initgraph(

by mamta devi on Thursday, February 2nd 2012 at 09:26 PM

#include"graphics.h"
#include"stdlib.h"
#include"math.h"
#include"stdio.h"
#include"stdarg.h"
#include"conio.h"
#include"string.h"
/*constant definition*/
#define PI 3.14159
#define NUME 30
#define DENOM 100
#define NUMBER 7
#define RAD 2.0
#define DTHETA 0.1
#define REDUX 3
#define SEGS 60
#define MIN 1
#define NFONTS 11
/* function prototypes */
void main();
void initgraph (void);
void tdisplay(int,float,int,int,int);
void cdisply(int,int,int);
void bucket(void);
/* global variables */
int gd=DETECT,gm;
int graphdriver,graphmode,maxcolors,errorcode,grok;
int xo,yo,maxx,maxy,xasp,yasp;
double aspectratio;
void initgrasph(void)
{
int gd=DETECT,gm;
if(errorcode!=grok){
printf("unable to register EGAVGA driver");
exit(1);
}
if(errorcode!=grOk)
{
printf("unable to register TRIPLEX font");
exit(1);
}
initgraph(

by mamta devi on Thursday, February 2nd 2012 at 09:26 PM

#include"graphics.h"
#include"stdlib.h"
#include"math.h"
#include"stdio.h"
#include"stdarg.h"
#include"conio.h"
#include"string.h"
/*constant definition*/
#define PI 3.14159
#define NUME 30
#define DENOM 100
#define NUMBER 7
#define RAD 2.0
#define DTHETA 0.1
#define REDUX 3
#define SEGS 60
#define MIN 1
#define NFONTS 11
/* function prototypes */
void main();
void initgraph (void);
void tdisplay(int,float,int,int,int);
void cdisply(int,int,int);
void bucket(void);
/* global variables */
int gd=DETECT,gm;
int graphdriver,graphmode,maxcolors,errorcode,grok;
int xo,yo,maxx,maxy,xasp,yasp;
double aspectratio;
void initgrasph(void)
{
int gd=DETECT,gm;
if(errorcode!=grok){
printf("unable to register EGAVGA driver");
exit(1);
}
if(errorcode!=grOk)
{
printf("unable to register TRIPLEX font");
exit(1);
}
initgraph(

by casino on Saturday, February 4th 2012 at 02:19 AM

The information and the detail were just perfect. I think that your perspective is deep, its just well thought out and really fantastic to see someone who knows how to put these thoughts down so wel Nice post.

by casino on Saturday, February 4th 2012 at 06:27 AM

I have been looking for a way to get the IP address on a windows application and Google sent me right here.


Comment Comment on this tutorial
Name: Email:
Message:
Comment Related Tutorials
There are no related tutorials.

Comment Related Source Code
There is no related source code.

Jobs C++ Job Search
My skills include:
Enter a City:

Select a State:


Advanced Search >>
Sponsors
Discover Geekpedia
Other Resources
Bargain EZ Tech Coupons & Deals