fork(2) download
  1. // If you are not sure what some lines of code do, try looking back at
  2. // previous example programs, or email a question.
  3.  
  4. // This header file allows the use of the string data type.
  5. #include <string>
  6.  
  7. using namespace std;
  8.  
  9. int main() {
  10.  
  11. // This declares an integer variable with the identifier "userAge"
  12. int userAge;
  13.  
  14. // This line sets userAge to contain the integer value 34
  15. userAge = 34;
  16.  
  17. // This line sets userAge to contain the integer value 23, overwriting
  18. // the previous value, 34
  19. userAge = 23;
  20.  
  21. // This line declares a character value with the identifier letterInput
  22. // and initializes it to hold the value 'c'
  23. char letterInput = 'c';
  24.  
  25. // Finally, this line declares a string value with the identifier address.
  26. // Note that "string" is not highlighted. Only the fundamental data types
  27. // are highlighted in your editor. Additionally, the value is initialized
  28. // with a string literal.
  29. string address = "1234 Nowhere St. Las Vegas, NV";
  30.  
  31. return 0;
  32. }
  33.  
Success #stdin #stdout 0s 3452KB
stdin
Standard input is empty
stdout
Standard output is empty