fork download
  1.  
  2. #include <iostream>
  3. #include <conio.h>
  4. #include <fstream>
  5. #include <stdio.h>
  6.  
  7. using namespace std;
  8.  
  9. struct work
  10. {
  11. char name[100];
  12. int id;
  13. char job[10];
  14. }p[10];
  15.  
  16. int main()
  17. {
  18. int i,b,d;
  19. char f[20];
  20. jumpe:
  21. for(i=1;;)
  22. {
  23.  
  24. cout<<"\nThe db++ Database application\n1-To enter the data\n2-To read the data\n3-To save the data\n";
  25. cin>>d;
  26. switch(d)
  27. { case 1:
  28. cout << "enter the no of workers to get the data:" << endl;
  29. cin>>b;
  30. for(i=1;i<=b;++i)
  31. {
  32. cout<<"\nenter the name of the worker:\n";
  33. cin>>p[i].name;
  34. cout<<"\nenter the id no of the worker:\n";
  35. cin>>p[i].id;
  36. cout<<"\nenter the job of the worker:\n";
  37. cin>>p[i].job;
  38. }
  39. goto jumpe;
  40.  
  41. case 2:
  42.  
  43. for(i=1;i<=b;++i)
  44. {
  45. cout<<"\nThe "<<i<<" name is "<<p[i].name<<" with id no "<<p[i].id<<"\n";
  46.  
  47. }
  48. goto jumpe;
  49.  
  50. case 3:
  51. ofstream file;
  52. file.open ("report.txt");
  53. for(i=1;i<=b;++i)
  54. {
  55.  
  56.  
  57.  
  58. file <<"\nThe "<<i<<" name is "<<p[i].name<<" with id no "<<p[i].id<<"\n";
  59.  
  60.  
  61. }
  62. file.close();
  63. cout<<"the file is saved";
  64. getch();
  65. goto jumpe;
  66.  
  67.  
  68.  
  69. }
  70.  
  71. }
  72.  
  73.  
  74. }
  75.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
1
1
Mohamed
1616
Stu
3
compilation info
prog.cpp:3:19: fatal error: conio.h: No such file or directory
 #include <conio.h>
                   ^
compilation terminated.
stdout
Standard output is empty