15,300 Posted Topics
Re: you have to flush the input keyboard buffer of the '\n' after each numeric input [code] cout << "Enter the players number :"; cin >> player[i].number; cin.ignore(); cout << "Enter the players points :"; cin >> player[i].points; cin.ignore(); [/code] line 34: that's an infinite loop because 0 is ALWAYS less … | |
Re: >>correct = compareNumbers[user, lottery]; First, compareNumbers is uninitialized, which is why you get the core dump. Second, what exactly is that line doing? compareNumbers is a simple integer, so how can you possibly use it like that ???? user and lottery are both int arrays. That doesn't make sense, but … | |
Re: [quote] Take the FileList as the only command line parameter. For example, C:\>TinyGoogle.exe myfilelist.txt[/quote] You need to create a file that contains the names of all the other files that your program is to index. So you have to create myfilelist.txt before you can do anything. >>what does the command … | |
Re: >>char play_again = '\n' make that = 'y' instead of '\n' because '\n' doesn't make sense >>while(play_again == '\n') check for 'y' instead of '\n' | |
Re: How about at the summer olympics ? Looks like Pepsi had a winner there :) | |
Re: [QUOTE=caperjack;585247]just found this searching google . [url]http://www.fixmyxp.com/content/view/187/129/[/url][/QUOTE] link doesn't work. But OP's intentions don't sound honorable to me. | |
Re: 1) I presume busy wait you mean the program displays something like the hourglass you see in browsers where the program continues to do something. The only purpose of the hourglass is to let the user know that the program is doing something that may take some time to complete. … | |
Re: >>This is the first question I have, does that mean studentType is the base class or persoType is the base class? personType is the base class. >>cout << studentList[count].getFirstName getFirstName is a function, so you need parentheses just like calling any other function [icode]cout << studentList[count].getFirstName() [/icode] Same with getLastName … | |
Re: Probably if you can find a web service other than IIS for MS-Windows. I thought Apache only ran on *nix, but could be wrong about that. | |
Re: you don't normally put executable code in a header file. All header files contain are function prototypes, classes , structures and macros. Everything else goes in the *.c or *.cpp implementation file. >> (9/5)*fahrenheit + 32 that is the same as 1 * fahrenheit + 32 because 9/5 = 1 … | |
Re: [code] struct Contribution { string name; double amount; }; const int MAX = 25; typedef Contribution BigSpender[MAX]; const string NAME_FILE = "names.txt"; const string CONTRIBUTION_FILE = "slush.txt"; void InitProgram( BigSpender& ContributionRec ); int main() { BigSpender ContributionRec; InitProgram( ContributionRec ); return 0; } void InitProgram( BigSpender& ContributionRec ) { return; … | |
Re: A structure is nothing more than a collection of items about a common topic. For example: If you want to know about students then you could write a student struct [code] struct student { char name[40]; // student's name int ags; // student's age char address[80]; char city[40]; char state[3]; … | |
Re: [code] This contains a tab This contains 4 spaces But this contains 8 spaces [/code] Just testing. I used Notepad to create the above text My suggestion is to change the option in your text editor to convert tabs to spaces because some people might use 8 spaces while others … | |
Re: >>cout<<tail<<head<<cost<<capacity<<endl; use the loop counter in this line [icode]cout<<tai[i]l<<head[i]<<cost[i]<<capacity[i]<<endl;[/icode] >>If possible I would like to try and figure out how to have it display the titles on top of the numbers... Simple -- print the titles just before line 36 (before the loop starts) | |
Re: [URL="http://www.microsoft.com/express/vc/"]Linky[/URL] But it is a little difficult to learn -- I'd suggest you start with [URL="http://www.bloodshed.net"]Dev-C++[/URL] until you get your feet wet. There are several other free compilers too. If you are interested in books then read one of the [b]Read Me[/b] threads at the top of this board. It … | |
Re: Read [URL="http://www.codecodex.com/wiki/index.php?title=Calculate_an_integer_square_root"]this[/URL] | |
![]() | Re: I would work though the tutorial first to find out how things go. Then it will be easier to understand QT. |
Re: Here is how to code that loop. You can delete lines 8, 10 and 19 [code] int count = 0; while( getline(fin, product[count]) ) count++; [/code] | |
Re: Depending on the compiler you are using you need to install the redistributable files that are found in your compiler's install directory. For examp VC++ 2008 Express files on my computer are here: D:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT Apparently you are using an earlier version of the compiler. Copy those … | |
Re: [URL="http://www.winprog.org/tutorial/"]tutorial here[/URL] This is complicated programming and you need to have a good understanding of C or C++ programming. Not a task for beginners. | |
Re: pOutData appears to be a pointer to a pointer or a 2d array of strings, like argv parameter to main() In either event line 5 can not work because strtok() only works with 1d character arrays. pOutData needs to be a pointer that is declared similar to the way you … | |
Re: [QUOTE=i_raghuveer;583656]please answer for this..i iwll be very grateful to u[/QUOTE] You didn't ask a question. All you did was dump your homework assignment here. | |
Re: Start at the top of the list you posted and do them just one at a time. Don't attempt to do them all at once. Do the first requirement then compile, correct bugs, and compile again until all problems have been fixed. Only then do you begin the next statement. | |
Re: Do you mean you deleted c:\temp ? Very Very bad thing to do because many other programs use that too for storing temporary files. Re-create that folder and the compiler will be happy. It you check the environment settings you will probably find one called TEMP=c:\temp. That's what programs look … | |
Re: post questions in the language of your choice, such as C, C++, C#, VB, etc. | |
Re: You sound like an accident waiting to happen. Go to bed and stay there for a week or two. :) | |
Re: You didn't even try, did you ??? See [URL="http://www.google.com/search?hl=en&q=Golay+Code+C+source&btnG=Google+Search"]these threads[/URL] | |
Re: also, windows.h doesn't define any c++ classes -- pure C, although you can use in in c++ programs. If the .h extension really bothers you then you could create your own file without the extension and have it call windows.h | |
Re: The use of num1 and num2 in lines 17 and 22 is destroying the values you entered on line 13 and 15. Use some other variables on lines 17 and 22 [code] for (int num3 = 1; num1 <= num1; num3++) { for (int num4 = 1; num4 <= num2; … | |
Re: You need to look for socket programming. Exactly how to do it depends on what operating system you are using. [url]www.DataReel.com[/url] has a large free library that contains client/server programs among other things and is ported to both *nix and MS-Windows. | |
Re: Even hear of [URL="http://www.google.com/search?hl=en&q=CreateFont"]google[/URL] ? If not, then you should learn to use it. | |
Re: I was thinking the same thing as vmanes when I watched that. All fluff and zero substance. Totally useless in business except maybe for flashy presentations. When is someone going to develop a hollagram monitor ? They've been around in sci fi movies for many years. | |
Re: >>10. Always wear a belt I wouldn't think of walking out of my house without one because my pants would fall to the ground and I'd have to flash everyone -- then I'd get tossed in jail for indecent exposure. >>9. White socks are only worn during athletic activities I … | |
Re: you should have had another category: [b]All the above[/b] :) | |
Re: line 29: recordcounter must be a const integer if it is to be used to set the array size as shown in lines 30-33. That means it must be a value > 0. [code] const int recordcount = 255; Person person[recordcounter]; [/code] lines 30-33: delete all but one those arrays … | |
Re: lines 9 and 10: why are those pointers? The whole purpose of the std::string class is to remove get rid of pointers and memory allocations from coder's obligations. There is no need at all for those two pointers lines 23 and 24: again, why? If you don't use the pointers … | |
Re: I'm supprised they would accept that kind of record because its so easy to cheat. And 30 replies is peanuts compared to many boards and in the Games board here at DaniWeb. One such game has almost 2,000 posts and that's one of the smaller ones. Now, something like "Online … | |
Re: >>if (buf[i] < 0 || buf[i] > 9) Wrong -- you need to check for '0' and '9' (in quotes). Your program has a major logic flaw. First assume the string is valid, then stop looking if any of the characters are not valid. The way you have it the … | |
Re: I tried to read some of those links -- horrible, someone needs to get off drugs. And the text fading in and out like that is extremly annoying. I'd delete this whole thread only because those links are soooo awful. | |
Re: The code you posted isn't very useful. Check for missing semicolons, especially at the end of the class declaration [code] class object { <snip> [color=red]};[/color] [/code] Looks like the problem may be in the way you have the header files included. food.h >> objects.h >> maincontrol.h >> food.h So nothing … | |
Re: post code. If its reading character by character then it will pick up spaces too. [code] char c; while( infile.get(c) ) { } [/code] | |
Re: use the isalpha() macro in ctype.h [code] bool GetString(char buf[]) { int i; int length; bool valid; cin.getline(buf, 30); length = strlen(buf); for (i = 0; i < length; i++) { if( !isalpha(buf[i]) ) { return false; } } return true; } [/code] | |
Re: line 4 is declared wrong. should be [icode]long long[/icode], not [icode]long int[/icode] To my knowledge there is not such thing as [b]long int[/b] | |
Re: Which of all those files contains the problem you are trying to resolve? queueTest.cpp ? In that file line 3 is just wrong [code] ostream out("outfile.txt"); <snip> queue.Print(out); [/code] | |
Re: Your program after line 7 is a big mess. Just delete all that junk. I don't know what all those parameters to the delete function are supposted to be, but you don't need any of them. All you have to do is open the input file, read the first and … | |
Re: I hope you realize that std::string in c++ programs is not the same as a String in VB. The function exported in the dll needs to be written in such a way that it can be called from languages other than c++, such as this: [icode]int _stdcall ss(const char* de)[/icode] … | |
Re: It might be compiler dependent, but VC++ 2008 Express will accept a 64-bit integer as the first parameter to seekg() which I guess means it supports huge files. | |
Re: Want a Ph.D. ? You can buy one [URL="http://www.ashwooduniversity.net/AU/online_registration.aspx"]here[/URL] for $600.00 USD :) | |
Re: [QUOTE=steven woodman;576306]ha, just got an infraction should have known better then to hit people with a gaypenis swinging site. Anyways I figured it might be cool to see if anyone else has gotten an infraction and what for. So if you've gotten one tell me how. SW[/QUOTE] You are lucky … |
The End.