6,741 Posted Topics
Re: >#include <getch> [b]If[/b] your compiler supports getch, it will most likely be in conio.h. But because getch is not a standard function, cin.get() is recommended instead: [code] #include <iostream> using namespace std; // Any other headers you need int main() { // Your program here cin.get(); } [/code] This will … | |
Re: >There are two types of computer programming errors ... It depends on the language and what you consider compile-time. Compilation usually consists of two distinct steps: compilation and linking. Both of those steps may have errors that are unique to the step. Therefore, I would say that there are three … | |
Re: >Is it possible to open notepad and type some gibberish and save it as a .exe file and run it? If you want to work out the machine code for your system that would be equivalent for a properly assembled executable, then figure out what combination of keyboard characters will … | |
Re: Post the error that you're getting. Often, a syntax error may not be on the line given by the message. It could be a few lines up and the effect of the error isn't seen by the parser until that line. | |
Re: >make a simple game using Java programming Application This can be as simple as a number guessing game. You don't have to write the next Quake engine. :rolleyes: >I'm sure to my self that I cant make it by my own Then you can't. If you don't believe in yourself … | |
Re: >address book i need it now!!!!! That's nice. >the program should be able to handle any amount of entries by using linked list and pointers. Well then, you should start by reading up on linked lists and get cracking rather than expecting other people to do your homework for you. … | |
Re: >could you help me in some questions If you bother to ask them, and in a separate thread unless they are [B]directly [/B]related to the original question asked in this thread or one of the replies. | |
Re: >now check if the input is valid or not by an if statement giving right parameters This is okay if the OP is forced to use such a braindead approach. Otherwise a series of 50 if statements is silly, and a table driven approach is far better. | |
Re: > while(!cin.eof() ) This is a bad idea and will probably result in you processing the last line of the file twice. A better method is to use your input as the condition: [code] while ( cin >> numGold >> numSilver >> numBronze ) [/code] Without knowing the format of … | |
Re: [code] System.out.println ( "" + test ( a, b ) ); [/code] | |
Re: >asking how to write a calender in c++ using for loop No problem: [code] int main() { for ( int i = 1; i <= 12; i++ ) print_calendar ( i, 2004 ); } [/code] Of course, the print_calendar function is slightly more complicated. ;) Here's a quick stab at … | |
Re: >is there a way for displaying or accessing system folders and files Yes, but it isn't built into the language. You will need to use a separate library or API. Might I suggest searching around on MSDN? | |
Re: >My program is reading the last line of data from an infile twice. I'll bet my next paycheck that your file processing loop looks like this: [code] while ( !feof ( in ) ) { /* Read from the file and process */ } [/code] Or this: [code] while ( … | |
Re: >pliz clarify this:is C++ dying or what coz this is the lang. am specialising in. No, C++ is not dying and anyone who says it is is very confused. | |
Re: Dare I ask what the Windows Firewall is doing during all of this? | |
Re: Problem: [code] delete pointArray; [/code] You allocate memory with new[], so you should release it with delete[]. Otherwise the behavior is undefined, and because the memory manager is usually very fragile, I wouldn't be surprised if that were your problem. | |
Re: While I can sympathize with your situation, that still doesn't give you a free lunch card. Instead of coming here and trying to get someone else to do your work for you, go talk to your instructor and work something out. If they're incapable of making extraordinary exceptions then get … | |
Re: Consider your boundary conditions. For each digit, unless the next outer loop is on the last iteration, you want to print 0 through 9. Otherwise you print 0 through the digit value. There isn't a very clean solution; you either use conditional expressions or long and redundant if sequences: [code] … | |
Re: >So far my attempts have not been successful What attempts have you made? What are you having trouble with? Opening the file? Reading from the file? Calculating the distance? Or setting up the matrix and filling it properly? | |
Re: >what is the best compiler What's the best pizza topping? Try again. >what is the best compiler out there that you can use for a variety of languages. Like is their a compiler that can compile c++, the basics, java, etc. Better. No such compiler exists. The closest you will … | |
Re: >How can I become good at VB6? If you have common sense then you can be good at VB6. ;) But seriously, the only way to become proficient in any programming language is to read about it and use it. A lot. | |
Re: >Can somebody help me write a perl script which totals the total amount of time that each user is using on the >system, as well as the number of processes the user is using. Pipe the result of a call to ps through your script and parse it, saving the … | |
Re: >Tell me how to create a C++ program using ADT to represent the (X) player in a tac tic toe game. What have you done by yourself so far? | |
Re: >how do you get to calculae a power. is it pow(...) Yes, that's one way. | |
Re: Download the latest [url=http://www.nvidia.com/object/nforce_udp_winxp_3.13]AGP filter driver from NVIDIA[/url] and install it, then try again. | |
Re: [fix] [COLOR=Red]I[/COLOR] use a nested while lo0p [COLOR=Red]because it's[/COLOR] much easier for me [/fix] Not everyone feels the same way as you, so don't push your opinions on anyone unless you state explicitly that they're opinions first. >Doing this process is not hard at all. No, it isn't. >I commented … | |
Re: It depends on how much crap you intend to hook up to your computer. 250 is the bare minimum, but for a powerhouse you'll be looking at 350 to 400+. | |
Re: Self-rebooting problems that I have seen were usually something to do with the power source. How far into the POST have you gotten? | |
Re: 1) sec and s refer to the same object, thus they have the same value. Subtracting 5 from 5 is 0. Replace 5 by x and you have the basis of what you're doing, x - x == 0. 2) It returns the time difference, but Sec remains the same … | |
Re: >i tried iostream without .h...and i get even more fatal errors...i guess i should reload? No, you should consider namespaces. An easy fix is to say using namespace std; after you include all of your headers. This isn't the best fix, but it is quick and usually works if you … | |
Re: >may i know how do i implement the circular linked list? Quick and dirty: [code] #include <iostream> using namespace std; struct node { int data; node *next; node ( int init, node *link ) : data ( init ), next ( link ) {} }; int main() { node *list … | |
Re: >If you meet any error plz inform me. Okay. >#include<conio.h> Nonstandard header, typically only Windows or DOS compilers will have it. But AFAIK Borland compilers are the only ones that have a fully featured conio.h. Using it is dicey at best because the functions from it that you use may … | |
Re: >Is there a way to convert a user entered (cin) char to an integer? If you want to read each digit separately then it's a lot harder. Your best bet would be to read the entire number as a string and then parse it: [code] #include <cctype> #include <iostream> #include … | |
Re: Empty your sent items folder if there aren't any large items in the inbox. | |
Re: >difference between c and c++ languages ++ >difference between templates and class, and structures and templates There's no comparison, the two solve different problems. >structures in c language and class C structures have fewer features. >difference between java and c++ A world. >explain memory allocation in c asnd c++ Ask … | |
Re: >Though it isn't recommended to do a statement like so Right answer, wrong reason. Assigning a string literal to a pointer to char is a deprecated feature in C++. The correct way would be: [code] const char *b = "123"; [/code] >why the object "b" isn't deleted? <---puzzle at here … | |
Re: >Just change the for loops into while loops! And this change is supposed to solve what, exactly? It makes no difference what kind of loop it is as long as they do the same thing, which they do. In this case a for loop is the better choice anyway because … | |
Re: >What I'm having trouble with is figuring out a way to keep track of which numbers were entered. You're on the right track with this: [code] int num[1]; [/code] An array of one is pretty useless, but if you change that to, say 10, you can use j to figure … | |
Re: There's no portable way to do this. Maybe if you told us what your operating system and compiler were we could help more. | |
Re: Visual Studio is an IDE, so you should just be able to create a project and add your header files and source files to the proper folders in that project. Then it's just a matter of typing F7 to build everything. | |
Re: >1. By value. Okay. >2. By pointer. Pointers are passed by value, let's not add to the massive amount of confusion surrounding pointers, k? ;) >3. By reference. Okay. You can also pass values and types to a function by way of templates. But the original question is rather vague, … |
The End.