home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

New To C++ Or C

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2092
Discussions: 200,973, Posts: 2,379,779, Members: 246,336
Old March 22nd, 2005, 10:32 PM   Digg it!   #1 (permalink)
Senior Member
 
Arenal's Avatar
 
Join Date: Mar 2005
Location: oklahoma, US
Posts: 557
Send a message via AIM to Arenal Send a message via Yahoo to Arenal
New To C++ Or C

Hey peeps, im brand new to this stuff, i've read the things about the cout, void main () {, etc etc., but i'm a little confused on the input aspect of it, if someone could explain it to me or give me a link to explain it for me.

I also was wondering what programs you used to perform C++ or C programming, i'm not looking to spend over $50 dollars.

Thanks for everything
__________________
RIP TKOP!!
Arenal is offline   Reply With Quote
Old March 22nd, 2005, 10:43 PM     #2 (permalink)
Senior Member
 
squeech's Avatar
 
Join Date: May 2002
Location: Rocky Mountain High
Posts: 613
If you want some nice tutorials of basic C/C++ concepts, and a good reference for functions as you get started programming, check out CPlusPlus.

I use Visual C++, but that's pretty expensive. I think Borland is a little more reasonably priced, and if you can use a linux machine the compiler and libraries are built into most distributions.

HTH
__________________
Talking in numbers doesn't make you smarter.
squeech is offline   Reply With Quote
Old March 22nd, 2005, 10:46 PM     #3 (permalink)
Senior Member
 
Arenal's Avatar
 
Join Date: Mar 2005
Location: oklahoma, US
Posts: 557
Send a message via AIM to Arenal Send a message via Yahoo to Arenal
Hmm, i have WinXP sadly ... and that site looks very good for starting aspects of C++, thanks a ton.

I'll just have to look around on google or in local software stores for my programming needs, CompUSA sounds good, or BestBuy.

Would Visual C++(Standard) be a good beginning program????
Arenal is offline   Reply With Quote
Old March 22nd, 2005, 10:49 PM     #4 (permalink)
Real gangstas sip on Yacc
 
jkrohn's Avatar
 
Join Date: Oct 2001
Location: Suckas-ville
Posts: 4,552
Send a message via ICQ to jkrohn Send a message via AIM to jkrohn Send a message via Yahoo to jkrohn
You can get borlands command line compiler for free. Used it for years.

Jkrohn
jkrohn is offline   Reply With Quote
Old March 22nd, 2005, 10:53 PM     #5 (permalink)
Senior Member
 
Arenal's Avatar
 
Join Date: Mar 2005
Location: oklahoma, US
Posts: 557
Send a message via AIM to Arenal Send a message via Yahoo to Arenal
And do you have a link to that or info on where to get that type of software?

Also does it have close to the same features as any other program?
Arenal is offline   Reply With Quote
Old March 22nd, 2005, 11:06 PM     #6 (permalink)
Real gangstas sip on Yacc
 
jkrohn's Avatar
 
Join Date: Oct 2001
Location: Suckas-ville
Posts: 4,552
Send a message via ICQ to jkrohn Send a message via AIM to jkrohn Send a message via Yahoo to jkrohn
It is simply a compiler. All compilers (for your intents and purposes) will do EXACTLY the same thing.

Visual C++ is an IDE and not completely compatible with standard C++.
http://www.borland.com/products/down..._cbuilder.html

Jkrohn
jkrohn is offline   Reply With Quote
Old March 22nd, 2005, 11:08 PM     #7 (permalink)
I am a banana!
 
originel's Avatar
 
Join Date: Jun 2002
Location: Texas Tech
Posts: 3,921
Send a message via AIM to originel
visual c++ has by far the most features of any IDE (integrated development environment). You also will not use 99% of its features. I've been doing windows development in C++ for a few years now, and I still only use about 30% of it.

For you, the borland compiler along with notepad is all you need. If you would prefer an IDE, you can check out dev c++ by bloodshed. It's free and is pretty useful.

http://www.bloodshed.net/devcpp.html

as for input...keyboard input works like this:

lets say you have a simple program like this
Code:
#include<iostream.h>
#include<string.h>

void main()
{
     string mystring;
     cout<<mystring<<endl;
}
What we have here is a simple program that declares a string and outputs the string. If you were not already aware, a string is a group of letters "strung" together. An example string is "Hello world needs to die."

To read a string in from the command prompt, add "cin>>mystring" between the other two commands so it looks like this:
Code:
#include<iostream.h>
#include<string.h>

void main()
{
     string mystring;
     cin>>mystring;
     cout<<mystring<<endl;
}
What this does in practice is lets the user type in a string and once they hit enter the string is printed back to the screen.
originel is offline   Reply With Quote
Old March 22nd, 2005, 11:18 PM     #8 (permalink)
Senior Member
 
Arenal's Avatar
 
Join Date: Mar 2005
Location: oklahoma, US
Posts: 557
Send a message via AIM to Arenal Send a message via Yahoo to Arenal
Ok what i'm confused about now is how to RUN the programs, do you just go to Run on your start menu?? and what the program's look like when run.

Also the >'s screw me up i never know why they are there.
Arenal is offline   Reply With Quote
Old March 22nd, 2005, 11:35 PM     #9 (permalink)
I am a banana!
 
originel's Avatar
 
Join Date: Jun 2002
Location: Texas Tech
Posts: 3,921
Send a message via AIM to originel
to run the program you have to first "compile" it. What a compiler does is take c++ code (or some other language) and convert it to machine code (1's and 0's). this is what the borland or dev c++ will do for you. Until you compile it, it's a useless text file. The compiler will also check your code for errors. When you run the program it will be a console program, meaning it will look like a DOS prompt.

for your purposes, the >>'s are just indicators. First you have the cin or cout command, then you have the carrots, which separate the command from the variable(s). The reason cin/cout use carrots instead of spaces is because you can string as many variables on as you want. for example, you could do something like:
cin>>variable1>>variable2>>variable3;
As a side note, endl in a cout statement just does a carriage return (enter). They're just placeholders really.
originel is offline   Reply With Quote
Old March 22nd, 2005, 11:48 PM     #10 (permalink)
Senior Member
 
Arenal's Avatar
 
Join Date: Mar 2005
Location: oklahoma, US
Posts: 557
Send a message via AIM to Arenal Send a message via Yahoo to Arenal
Okay i think i understand that,
And when it says prints, does it mean writes it on the screen??
Thanks for all your help ahead of time.
Arenal is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Charges against non-tippers dropped.. (8)
Is It Just Me? (3057)
The disrespect of Obama by Russian .. (48)
Delete an OS (16)
Nvidia GTX 260 problem (8)
Laptop with wireless problem. (12)
Wireless Televisions. (12)
CPU fan stops spinning randomly (11)
windows vista security holes (17)
Regular Build (11)
windows 7 problem (7)
Internet Lost (5)
Point and Shoot Camera Suggestions. (6)
Print spooler problem (16)
Recent Discussions
Delete an OS (16)
Multiple Restarts Required at Boot (4)
cell phone won't work (0)
Nvidia GTX 260 problem (8)
Is the PSU I received dead? (15)
Can't open Word (12)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (37)
Steam ID's, Gamertags etc... (4)
Games, Cables, PCI cards, and more fo.. (6)
Dept. of HS: NSA 'Helped' Develop Vis.. (17)
Linksys WMP54GS wireless card problem.. (5)
windows vista security holes (17)
Help getting around port 80 for camer.. (5)
Skillsoft Network+ Study Software Que.. (10)
Browsers wont load websites (3)
help me pls laptop just stopped worki.. (0)
Open With ..... Win7 (3)
Laptop with wireless problem. (12)
Internet Lost (5)
virus blocking exe. files (1)
Point and Shoot Camera Suggestions. (6)
CPU fan stops spinning randomly (11)
Modern Warfare 2: Who Bought It? (65)
Print spooler problem (16)
Kingston Bluetooth Dongle Driver (1)


All times are GMT -4. The time now is 10:58 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28