Q
Quiddity
Guest
how would i make a hello world application in vs .net?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: this_feature_currently_requires_accessing_site_using_safari
#include <iostream>
using std::cout;
using std::endl;
int main()
{
cout << "Hello, world!" << endl;
return 0;
}
Originally posted by Quiddity
isn't C++ How to Program by Deitel for vs 6.0 and such
should i get the one by them called Visual C++.NET: How to Program?
Originally posted by Infernal-Shade
Code:#include <iostream> using std::cout; using std::endl; int main() { cout << "Hello, world!" << endl; return 0; }
Might I suggest a good book, such as C++ How to Program by Deitel? :cheese:
#include <iostream>
int main() // The function main()
{
std::cout << "Hello, world!" << "\n"; // cout (short for output, basically) prints these words to the screen in a black console box
return 0; // since the function main doesn't return a value, it returns zero, or void
}
Originally posted by bobvodka
dear god, over commenting hell. With something that simple at the most you need a comment on the line above and in most cases you dont need line by line commenting. If you was taught that then you've been taught bad habits yourself
Funny... I thought the EXACT same thing...I was thinking someone made his first automatic forum spammer by the title. Oh well.
// a small c++ program
#include <iostream>
#include <string>
int main()
{
// ask for name and then start framed greeting
std::cout << " please enter your name. ";
// read the name
std::string name; // defines name
std::cin >> name; //read into the name
//build message
const std::string greeting = "Hello, " + name + "!";
//build 2nd and 4th lines
const std::string spaces(greeting.size(), ' ');
const std::string second = "* " + spaces + " *";
//build 1st and 5th lines
const std::string first(second.size(), '*');
//write it all
std::cout << std::endl;
std::cout << first << std::endl;
std::cout << second << std::endl;
std::cout << "* " << greeting << " *" << std::endl;
std::cout << second << std::endl;
std::cout << first << std::endl;
return 0;
}
#include <iostream.h>
void main()
{
cout << "Hello world!\n"
<< "How are you doing today?\n"
<< "ME AM FINE!";
//Using one cout statement to do all these quotes is fine...
//But don't do too many!
}
std::cout << "Hello World\n"; //"Hello World"
#include <iostream.h>
int main()
{
cout << "Hello world." << endl;
return 0;
}
Sandman said:Why do you guys use that? It doesn't change anything, to my knowledge... I just write it like this:
Code:#include <iostream.h> void main() { cout << "Hello world!\n" << "How are you doing today?\n" << "ME AM FINE!"; //Using one cout statement to do all these quotes is fine... //But don't do too many! }