How can I do this in C++?
336187
check out the enum()  function.\n\n\n\nfor example \n\nenum e_months {JAN=1, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC};\n  typedef enum e_months month;\n\n  month currentmonth;\n  currentmonth = JUN;      /* same as currentmonth = 6; */\n  printf("%d&#92;n", currentmonth);\n\nshoot, you could also do something as wicked as this\nbut your instructor is probably going to laugh at you. \n\n#define JAN 1\n#define FEB 2\n#define MAR 3\n/* ... etc ... */
1048980
http://www.cprogramming.com/tutorial.html\nhttp://www.cplusplus.com/doc/tutorial/\nhttp://visualcplus.blogspot.com/\n\nall taken from yahoo seach. you can search for c c+ tutorials and come up with hundreds if these don't do it for you.
681415
please have a look on this.. \n\n\nhttp://www.cprogramming.com/tutorial/template_specialization.html
876944
I'm not fully sure of what you're trying to do here, but if you're trying to make sub-menus you can simply put all of the cout and cin statements for each sub-menu in between the cout<<" You selected... etc."; and the break statements. If you want it in another function, you can do:\n\nint main() {\n\n   //Other lines of code...\n\n   switch (choice)\n   {\n      case 1:\n         cout<< " You selected item 1.&#92;n";\n         //Call the first menu\n         menu1();\n         break;\n      }\n   }\n\n   void menu1() {\n      //This is the first menu!\n      int choice;\n      cout<< "This is the first menu...&#92;n";\n      cout<< "Pick something!&#92;n";\n      cin>> choice;\n      //Do other stuff here\n   }\n\n\nSorry if this doesn't help; I don't know C++ very well, and if you could expand on what you want to do I could help more. If this is what you want, then it's all good!
604118
This is an identical java code for your C++ code,\n\n1. create a filename, say HelloWorld.java,\n\n2. Write in following codes,\n\npublic class HelloWorld\n{\n      public static void main (String args[])\n      {\n           System.out.println("Hello World");\n      }\n}\n\n3. Save it and compile it. Then open the class file using java.
781094
Nobody is going to do your homework for you. \n\nIf you're supposed to write code examples that illustrate how two comparable programs might look, then do this. Write some simple programs in C, and then re-write the same program in C++ but put the functions your void main calls in a class and instantiate the class.
779217
There are built-in functions in a programming language to perform that task.For instance in C++ we have: cint("string value") for converting the string value into integer.And in Visual Basic we have the val() function to do the same thing.
423121
are you talking about c++? i have a nice header file that i can give you.. maybe thatll help
646616
class publication\n{\n   private :\n      char title[20];\n      float price;\n   public :\n      void getdata()\n      {\n          cin>>title;\n          cin>>price;\n      }\n};\nclass books :: public publication\n{\n   private :\n      int pagecount;\n   public :\n      void getdata()\n      {\n          cin>>pagecount;\n      }\n\n};\nclass tape :: public publication\n{\n   private :\n      int playing_time;\n   public :\n      void getdata()\n      {\n          cin>>playing_time;\n      }\n};
678911
Check out the site at http://www.pscode.com - I don't do C++ but I use that site all the time for Visual BASIC stuff I work on.
1162883
If you are using microsoft visual studio, I have a small demo app that will show how to do it. just email me and I'll send it.
614947
#include <iostream.h>\n#include <conio.h>\n#include <process.h>\n\nmain()\n\n{\n\nchar c;\n\nclrscr();\ncout<<"Press 0 to exit&#92;n";\n\ndo\n{\n\n c=getch();\n\n switch(c)\n {\n   case '0': exit(0);\n   case '1': cout<<"I";break;\n   case '2': cout<<"L";break;\n   case '3': cout<<"o";break;\n   case '4': cout<<"v";break;\n   case '5': cout<<"e";break;\n   case '6': cout<<"U";break;\n }\n\n} while (1);\nreturn 0;\n}
930756
#include<iostream>\nusing namespace::std\n\nvoid main(){\ncout<<"Plz enter a number"<<endl;\nint x;\ncin>>x;\nif(x!=4)\n{\ncout<<"Well Done"<<endl;\n}\nelse {\ncout<<"The Number You Entered is 4"<<endl;\n}\n\n};\n\nI GUESS THIS IS WHAT YOU MEAN. YOU DONT NEED A BOOLEAN OPERATOR IN THIS CASE.
270512
Would be something roughly like this:\n\n#include <cstdlib>\n#include <iostream>\n#include <fstream>\n#include <string>\n\nusing namespace std;\n\n\n\nint main(void)\n{\n    string  T;\n    ifstream inf;\n    ofstream outf;\n    inf.open("myfile.txt", ios::in);\n    outf.open("YourFile.txt", ios::out);\n    while(!inf.eof()){\n        getline(inf, T, '&#92;n');\n        outf << T << "&#92;n";\n        }\n    inf.close(); \n    outf.close();\n    system("PAUSE");\n    return EXIT_SUCCESS;\n}\n\nI think.
1174010
Buy a book. Online tutorials never helped me. I bought C++ for dummies. Its not bad.
225161
The quick answer is that you would know how to program in c++. I dont think most people would want to write that for you just to give an answer but you never know. \n\nTry using planetsourcecode and see if you can find something similar enough to modify...
315617
void StrReverse4(char *str)\n{\n    if(*str)\n    {\n        StrReverse4(str+1);\n        putchar(*str);\n    }\n}\n\nTry this code it might work