Advertisement
heimsventus

25 strings properties and objects

Jan 25th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. // ConsoleApplication3.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "stdafx.h"
  6. #include <iostream>
  7. #include <string>
  8. #include <cmath>
  9. using namespace std;
  10. int main()
  11. {
  12.  
  13.     float myfloat = 100.50;
  14.     double mydouble = 100.50;
  15.     char mychar = 120;
  16.     bool istrueorfalse = true;
  17.     istrueorfalse = 1;
  18.     string firstname$ = "david";
  19.  
  20.     cout << firstname$ << endl;
  21.     cout << mychar << endl;
  22.     cout << "this first name has" << firstname$.length() << "characters in it "<< endl;
  23.     cout << "the third letter in the name is " << firstname$[2] << endl;
  24.  
  25.  
  26. unsigned int myunsignedint = 200;
  27.  
  28.  
  29. system("pause");
  30.  
  31. return 0;
  32.  
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement