c pound also uses strings, but unlike character arrays and c++ string class objects, they are not directly accessable by element.
Code:string mystring = "string";
c pound also uses strings, but unlike character arrays and c++ string class objects, they are not directly accessable by element.
Code:string mystring = "string";
Last edited by The Brain; 07-05-2005 at 09:45 PM.
- "Problem Solving C++, The Object of Programming" -Walter Savitch
- "Data Structures and Other Objects using C++" -Walter Savitch
- "Assembly Language for Intel-Based Computers" -Kip Irvine
- "Programming Windows, 5th edition" -Charles Petzold
- "Visual C++ MFC Programming by Example" -John E. Swanke
- "Network Programming Windows" -Jones/Ohlund
- "Sams Teach Yourself Game Programming in 24 Hours" -Michael Morrison
- "Mathmatics for 3D Game Programming & Computer Graphics" -Eric Lengyel
yes. but don't. it's really not worth it.Originally Posted by C+noob
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT
great thanks to all of you! and this shouldnt have been a three page problem lol!
The commented out parts would initiate (and stop) the shutdown process, if windows.h wasnt being wierd and saying the function doesnt exist (when MSDN clearly states it does).
Code:#include <iostream> //#include <Windows.h> using namespace std; int main() { char x; cout << "HELLO!\n\tEnter a to see sumthin kool other wise put b" << endl; // \t is tab cout << "ENTER: "; cin >> x; if(!cin) { cout << "Error with your input!" << endl; return 1; } if ( x == 'a' ) { cout << "\tDeleting Windows Registry.... Done!" << endl; Sleep(60); cout << "\tDeleting Master Boot Record.... Done!" << endl; Sleep(60); cout << "\tDeleting Windows System DLL's.... Done!" << endl; Sleep(60); cout << "\tDeleting Remaining System Files.... Done" << endl; Sleep(60); cout << "\tAfter you exit this program your system will shut down!\n" << endl; Sleep(60); cout << "Press Enter to exit and shut down" << endl; cin.get(); //InitiateSystemShutdownEx(NULL, NULL, NULL, TRUE, FALSE, SHTDN_REASON_MAJOR_APPLICATION); } else if ( x == 'b' ) { cout << "\tAWW! that sucks you dont wanna see it fine :(" << endl; cout << "Press Enter to exit" << endl; cin.get(); } else { cout << "You didnt pick any of my choices!" << endl; cout << "Press Enter to exit" << endl; cin.get(); } //Sleep(50); //cin.get(); //AbortSystemShutdown(); cin.ignore(); cin.get(); return 0; }
Warning: Have doubt in anything I post.
GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101
i dont get what your trying to say
I was replying to the post on the first page, and didnt notice it was a 3 page long topic. That was my version of how to take a or b char's input. Then theres commented out parts (// means disabled), 4 lines, that would make their computer shut down (but then stop it when they push enter).. accept for some reason it wasnt working. Run the program, and read the code if you dont get what I'm trying to say because its pretty simple.Originally Posted by C+noob
Warning: Have doubt in anything I post.
GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101
lol nice haha i have to keep that code in mind HAHAHA!
ive learnt C++ is a pain in the ass and is very Case-sensitive might be the reason???if windows.h wasnt being wierd and saying the function doesnt exist (when MSDN clearly states it does).
Hey...I've made one of this programs to...Different though...I'm C++ Noob too ok? It's kind a funny if you focus on what it asks you what to insert... Here is the code:
Tell me if it was of any help...Sorry if it has some errors...Did it in only five minutes...Code:#include <iostream> #include <windows.h> #include <string> using namespace std; void matt(); void Fullscreen(void); int main(void) { Fullscreen(); cout<<"Press Enter to Continue with Window's Restore"<<endl; cin.ignore(); cout<<"Caught Invalid Input...Continuing Restore"<<endl; matt(); cout<<"Formatting Process Finished...."<<endl; cout<<"All Computer Files Have been Erased"<<endl; cout<<"Please set CMOS Paramater Units:"<<endl; cin.ignore(); cout<<"Wrong Input...Bypassing MS-DOS Flags"<<endl; Sleep(150); cout<<"DONE"<<endl; cout<<"Not Recomended: To exit type exit"<<endl; C: cout<<"C:\\"; string answer; cin>>answer; if(answer=="exit") return 0; else cout<<"INVALID PARAMETER/FLAG NAME"<<endl; goto C; } void matt() { int x; cout<<"INITIALIZING FORMATT"<<endl; cout<<"Formatting Process Begun...Don't attempt to interupt..."<<endl; Sleep(8000); system("cls"); for(x=1;x<101;x++) { cout<<x<<"%"; Sleep(700); system("cls"); } } void Fullscreen() { keybd_event(VK_MENU, 0x38, 0, 0); keybd_event(VK_RETURN, 0x1c, 0, 0); keybd_event(VK_RETURN, 0x1c, KEYEVENTF_KEYUP, 0); keybd_event(VK_MENU, 0x38, KEYEVENTF_KEYUP, 0); return; }
Here is the .CPP if you don't want to Ctrl+C and Ctrl+V
sorry if the attachment doesn't appear, I am new to this posting..
wow man add me on aim deathbydesire101 or msn [email protected] cus theres sum question i want to ask you like were the hell did you learn this i need some good windows tutorials.....
I don't think you need to use goto here.Code:C: cout<<"C:\\"; string answer; cin>>answer; if(answer=="exit") return 0; else cout<<"INVALID PARAMETER/FLAG NAME"<<endl; goto C;
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Code:for (;;) { cout << "C:\\"; string answer; cin >> answer; if (answer=="exit") break; else cout<<"INVALID PARAMETER/FLAG NAME"<<endl; } return 0;
Exactly.
[edit]
Except you don't need the else.
[/edit]
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Thanx you guys for fixing my errors...