You are viewing our Forum Archives. To view or take place in current topics click here.
c++ need help...................
Posted:

c++ need help...................Posted:

privateryan93
  • New Member
Status: Offline
Joined: Jun 20, 201113Year Member
Posts: 33
Reputation Power: 1
Status: Offline
Joined: Jun 20, 201113Year Member
Posts: 33
Reputation Power: 1
hi i recently downloaded a book so i could learn c++. i know nothing about it so i thout this book would do. i have visual basic 2010 and when i type this line exactly from the book nothing happens

// my first program in C++
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World!";
return 0;

that is exactly how the book tells me to type it.
[img]http://tinypic.com/r/futu8/6[/img]


this is what it looks like in the book
[img]http://tinypic.com/r/20qb52s/6[/img]

any help would be nice
#2. Posted:
shadoweagle
  • New Member
Status: Offline
Joined: Aug 09, 200915Year Member
Posts: 37
Reputation Power: 1
Status: Offline
Joined: Aug 09, 200915Year Member
Posts: 37
Reputation Power: 1
you forgot the ending curly brace } so add it or copy and past this code. there should be no errors.

#include <iostream>

using namespace std;

int main(){
cout<<"welcome";

return 0;
}
#3. Posted:
TurnerTheTiger
  • Gold Gifter
Status: Offline
Joined: Apr 06, 201212Year Member
Posts: 750
Reputation Power: 37
Status: Offline
Joined: Apr 06, 201212Year Member
Posts: 750
Reputation Power: 37
Do what shadoweagle said also since your just beginning use Notepad++ google it is more simple to use when you are new to coding in fact i still use it after 2 years.
#4. 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
iFinish wrote Do what shadoweagle said also since your just beginning use Notepad++ google it is more simple to use when you are new to coding in fact i still use it after 2 years.


Implying notepad++ is easier then a real IDE for C++.


Also op, this may be your problem besides your C+Pin
hi i recently downloaded a book so i could learn c++. i know nothing about it so i thout this book would do. i have visual basic 2010
#5. Posted:
Experiment5X
  • TTG Senior
Status: Offline
Joined: Aug 14, 200915Year Member
Posts: 1,291
Reputation Power: 65
Status: Offline
Joined: Aug 14, 200915Year Member
Posts: 1,291
Reputation Power: 65
You're trying to run C++ code in a VB compiler, that won't work lol. In order to run C++ code you need to download a C++ compiler/IDE. The best one in my opinion is Visual C++ 2010, but if you're looking for a lighter IDE, you could use Code::Blocks.
#6. Posted:
PHP_Pro
  • Ladder Climber
Status: Offline
Joined: Oct 12, 201113Year Member
Posts: 349
Reputation Power: 20
Status: Offline
Joined: Oct 12, 201113Year Member
Posts: 349
Reputation Power: 20
Experiment5X wrote You're trying to run C++ code in a VB compiler, that won't work lol. In order to run C++ code you need to download a C++ compiler/IDE. The best one in my opinion is Visual C++ 2010, but if you're looking for a lighter IDE, you could use Code::Blocks.


Can you compile Native code in visual C++?, or is it going to be reliant on the .NET Framework ? if you can, then im going to switch...
#7. Posted:
Experiment5X
  • TTG Senior
Status: Offline
Joined: Aug 14, 200915Year Member
Posts: 1,291
Reputation Power: 65
Status: Offline
Joined: Aug 14, 200915Year Member
Posts: 1,291
Reputation Power: 65
PHP_Pro wrote
Experiment5X wrote You're trying to run C++ code in a VB compiler, that won't work lol. In order to run C++ code you need to download a C++ compiler/IDE. The best one in my opinion is Visual C++ 2010, but if you're looking for a lighter IDE, you could use Code::Blocks.


Can you compile Native code in visual C++?, or is it going to be reliant on the .NET Framework ? if you can, then im going to switch...


Yup.
#8. Posted:
Tolerated
  • TTG Addict
Status: Offline
Joined: Oct 10, 201113Year Member
Posts: 2,175
Reputation Power: 94
Status: Offline
Joined: Oct 10, 201113Year Member
Posts: 2,175
Reputation Power: 94
I think you should use system("PAUSE"); instead of return 0; because it will end straight away once the process has finished, but with system("PAUSE"); you can analyse it so its much better, that is just my opinion.
#9. 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
Never, ever ever use system("PAUSE");
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.