Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.12 KB | None | 0 0
  1. //HELLO WOLRDING
  2.  
  3. #include "main.h"
  4. #include <QtCore>
  5. #include "iostream"
  6. #include"fstream"
  7. #include "vector"
  8. //#include <QtCore/QCoreApplication>
  9. #include <QDebug>
  10.  
  11. int wall::total = 0;
  12.  
  13. wall::wall(){
  14. total++;
  15. x = 50;
  16. y = 60;
  17. xy = x+y;
  18. stringy = "[eq";
  19. }
  20.  
  21. wall::~wall(){
  22. total--;
  23. }
  24.  
  25. void Lession01(){
  26.     int sz = 5000000 ;
  27.     qint64 tsz = 0;
  28.         house* I = new house[sz];
  29.  
  30.         qDebug()<<"objects count"<< I->total;
  31.         qDebug()<<"size of 1 object"<< sizeof(house);
  32.         for (int i = 0 ; i < sz ; i++){
  33.             tsz+=sizeof(I);
  34.  
  35.         }
  36.         qDebug()<<"fullsize equals to:" << tsz << "bytes" << (tsz/1024.00)<< "KiB" << ((tsz/1024.00)/1024.00) << "MiB";
  37. }
  38.  
  39. void Lession02(){
  40.     using namespace std;
  41.  
  42. vector<string> str;
  43. ifstream in("1.txt");
  44. string stri;
  45. while(in>>stri){
  46.     str.push_back(stri);
  47.     }
  48. for (int i = 0; i<str.size();i++){
  49.     qDebug()<<QString::fromStdString(str[i]);
  50. }
  51.  
  52. }
  53. void Lession03(){
  54.  
  55. }
  56.  
  57.  
  58.  
  59. int main(int argc, char *argv[])
  60. {
  61.     QCoreApplication a(argc, argv);
  62. //Lession01;
  63.     Lession02();
  64. //Lession03;
  65.  
  66.     return a.exec();
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement