- Standard C++
- cppreference.com
- cplusplus.com/reference
- C++ Core Guidelines
- C++ Language Reference
- C/C++ Language and Standard Libraries
- cplusplus.com
- C++ documentation
- gcc
- Stanford CS 106B
- Stanford CS 106L
- Stanford CS Education Library
- C++ FAQ
- C++ Primer Plus by Stephen Prata
Please visit here.
#include <stdio.h>
#include <iostream>
using namespace std;
int main(int argc, const char *argv[])
{
printf("%s %d\n", "Hello World", 10);
cout << "Hello World!";
return 0;
}
// Hello World 10
// Hello World!You can either:
cd code/andg++ -std=c++11 hello.cppand./a.outcd code/andg++ -std=c++11 hello.cpp -o helloand./hello
int argc, const char *argv[] is used to get arguments
from command line. If you do not need to process it,
just use int main() or int main(void).
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
// Check the number of parameters
if (argc < 2) {
cerr << "Usage: " << argv[0] << " NAME" << endl;
return 1;
}
// Print the user's name:
cout << argv[0] << "says hello, " << argv[1] << "!" << endl;
}
/*
$ ./a.out Gyu-Ho
Then
./a.outsays hello, Gyu-Ho!
*/
