| | |
Projects in C++
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
He friends,
I would like to have some guidance over projects to take up in C++?
I would like to take up a challenging project . Also I have changed my compiler from turbo C++ to Dev C++ but i cannot figure out how the output can be seen ie the output window. Also how do we step into or step over .
Thanks for your help,
comwizz.
I would like to have some guidance over projects to take up in C++?
I would like to take up a challenging project . Also I have changed my compiler from turbo C++ to Dev C++ but i cannot figure out how the output can be seen ie the output window. Also how do we step into or step over .
Thanks for your help,
comwizz.
I don't want to step on any C++ toes, but there is a "Projects for Beginners" thread in the Python forum. Much of it is applicable to C++ programmers too. Take a look at:
http://www.daniweb.com/techtalkforums/thread32007.html
For Dev-C++ users there is a little handholding advice in this code snippet:
http://www.daniweb.com/code/snippet82.html
Also for console programs here are ways to make the console output wait for a key stroke, so you can read the output:
I am a little skittish posting in the C++ forum, since I have been kicked out of here unceremoniously in the past.
http://www.daniweb.com/techtalkforums/thread32007.html
For Dev-C++ users there is a little handholding advice in this code snippet:
http://www.daniweb.com/code/snippet82.html
Also for console programs here are ways to make the console output wait for a key stroke, so you can read the output:
C++ Syntax (Toggle Plain Text)
// wait for key press at end of console program #include <iostream> using namespace std; void wait(); int main() { // Your code here // C++ cin.sync(); // purge any \n cin.get(); // console wait // or // clear the stream, purge any \n while (cin.get() != '\n') ; cin.get(); // wait // or // more complete while (std::cin.get(ch) && ch != '\n') ; cin.get(); // wait // or cin.ignore ( 1024, '\n' ); cin.get(); // wait // or cin.get(); // trap loose \n cin.get(); // wait wait(); // write your own, for C++ // system("PAUSE"); // wait, not portable // C // clear the stream while ((ch = getchar()) != '\n' && ch != EOF); getchar(); // for C, same caveat as cin.get() return 0; } // portable, need to declare prototype unless // function precedes call void wait() { cout << "Press any key to continue ..."; string z; getline(cin,z); }
May 'the Google' be with you!
>cin.sync(); // purge any \n
This non-portable. From a standard perspective, it's also nonsensical for sync to discard the contents of the buffer. I've discussed it at length here.
Magic numbers should be avoided:
This only works if the only thing left in the stream is a newline.
That's seriously overkill, and the prompt is misleading because getline is line oriented. You can hit any key, but unless that key is Enter, nothing will happen.
>I am a little skittish posting in the C++ forum, since I have been kicked out of here unceremoniously in the past.
I don't recall you being "kicked out". Can you link to the offending thread?
This non-portable. From a standard perspective, it's also nonsensical for sync to discard the contents of the buffer. I've discussed it at length here.
C++ Syntax (Toggle Plain Text)
cin.ignore ( 1024, '\n' ); cin.get(); // wait
C++ Syntax (Toggle Plain Text)
#include <ios> #include <limits> cin.ignore ( numeric_limits<streamsize>::max(), '\n' ); cin.get(); // Wait
C++ Syntax (Toggle Plain Text)
cin.get(); // trap loose \n cin.get(); // wait
C++ Syntax (Toggle Plain Text)
cout << "Press any key to continue ..."; string z; getline(cin,z);
>I am a little skittish posting in the C++ forum, since I have been kicked out of here unceremoniously in the past.
I don't recall you being "kicked out". Can you link to the offending thread?
I'm here to prove you wrong.
![]() |
Similar Threads
- .NET projects (ASP.NET)
- Web designer team seeks more projects! (Post your Resume)
- Open Source Projects (C++)
- Beta-projects request peoples help, Read More! (Software Development Job Offers)
Other Threads in the C++ Forum
- Previous Thread: save ARRay elements to a file
- Next Thread: Borland C++5.5 compiler - shortcut ?
| Thread Tools | Search this Thread |
api array arrays based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news number numbertoword output parameter pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






