wiki:cypress/Programming/CppExamples

C++ codes

Hello World

//hello.cpp: display a message on the screen 
#include <iostream>
 
int main()
{
   std::cout << "Hello, C++ world!\n";
   return 0;
}
  • Text after are comments.
  • can use C style comments.
  • can use C functions.
  • #include <iostream> to load the header file.
  • There are many header files in the standard C++ library.[1]
  • Program always begins with main() function.
  • main() returns a integer.

Compile with GNU C++

g++ hello.cpp

Compile with Intel C++

icpc hello.cpp

Links for tutorial

Examples of Job Script

See Examples

Parallel C++

Useful Libraries for Scientific Computing

deal.II - A Finite Element Differential Equations Analysis Library, tutorial

Last modified 5 years ago Last modified on May 15, 2015 9:48:06 AM