2,045 Posted Topics
Re: Now, what is the error that the compiler is giving you? | |
Re: Based on the information you have found thus far, choose an approach and try to implement it. Someone can then tell you if you're on the right track. | |
Re: Line 69: an else statement has no condition, and you have placed a semicolon after it by mistake. For something that uses a file, try keeping a high score log. | |
Re: Change line 10 to [icode] cout<<Emails<<endl; [/icode], that will print out the whole string. | |
Re: To post quotes as automatically expanded hit "Post Reply" and go to where it says "[QUOTE=happygeek;1408366]". Just click where it says 'Click to Expand/Collapse' and the quote will, erm, expand or collapse. Now delete the ";1408366" (or whatever the post number is) | |
Re: [quote]The program '[3636] kjega;kew.exe: Native' has exited with code 0 (0x0).[/quote] For future reference this means that the program has reached the end of main() successfully. The pdb errors simply indicate that VS has no debugging information (Intellisense, etc) for those DLLs. | |
Re: So what's the problem? Can you break it down to a specific section or method of one of the classes? | |
Re: That number exceeds the largest value of the signed (and even unsigned) 32-bit integer. If you need numbers that large, your instructor may be seeking a solution where you represent your numbers by an array or ints or chars. | |
Re: The prompts are reversed for first and last name. Also, test your program with a two word first name (like Betty Sue) and see what happens... | |
Re: How can we help you if we don't know which errors you are getting? Also please use [noparse][code][/code][/noparse] tags around your code. | |
Re: Hint: what do lines 26 and 28 tell you about your Function class. Also, see if you can get some of the implementation of Find. We can't truly know that your professor didn't give you this much with which to start. | |
Re: Why not make the ofstream elements members of their respective classes? (and instantiate them in the class constructor) I'm not sure if that will solve the problem, but it will make your code neater at a minimum, and global variables are never a good idea. Also, with the standards, the … | |
Re: Can you use an array of boolean values? See where you can go with that, or if that's not really what the professor intended then see if you can rework it. | |
Re: You don't need the '&'s on lines 7,9,24. You are trying to compare addresses of those values. Once you've passed something in by reference (i.e., using & in the function definition) you just access it like any other variable. | |
Re: You need to reset the counter on or about line 36. Otherwise you are just skipping your while loop each time (you will want to reset your counts around the same point). Minor point, but int should be unsigned on line 26. | |
Re: The mainstream library ([url]http://sourceforge.net/projects/opencvlibrary/[/url]) [I]does[/I] work under C++, and a couple of people around here are familiar with it (I've built against it before, but nothing fancy), but I agree with ravenous that it would be helpful to see the compiler error. | |
Re: Please edit your post to include code tags, [noparse][code]//put your code here[/code][/noparse] There's still time to do so. There is an issue that you are using an outdated compiler and library that most of us do not have access to, so can you narrow down your problem to a few … | |
Re: What exactly is the problem? Hint, lines 53, 60, 62, your comments do not match what you have written there. You are overwriting the value, not adding to it. | |
Re: Which type of strings are you using? (C-strings or std::string) If you are using std::string, then there are methods like .find() which will work. Since it is your assignment, you probably can't use the built in methods, so the easiest way is to treat the string like an array and … | |
| |
Re: What is specifically wrong with the code? Also, look at line 26, your array has 5 elements [icode] VoteArray[0],VoteArray[1],VoteArray[2],VoteArray[3],VoteArray[4] [/icode]. Your loop is trying to access element 5 which doesn't exist. | |
Re: One thing is, you need to treat the outer border (column 0 and 21, row 0 and 21)as special so you don't go out of bound on your array. For example on line 100, in cell (0,0) it tries to read [icode] lifeGrid[-1][-1]. [/icode] You may be lucking out and … | |
Re: What is it not doing? (or what is it doing that you didn't expect?) In other words, point us in a direction. Also, posting a snippet of your data file would allow someone to test it. Also, when you have written in a 1 element array, you don't need it. … | |
Re: total, SIZE, and avg are all ints. Change avg to a double and cast either total or SIZE (or both) to a double. [icode]double avg = (double)total/SIZE; [/icode] Even though avg is a double, the result of int/int division is in integer and therefore truncated. | |
Re: You could overload the < and > operators for your class (which simply compare the prices of two different items) See: [url]http://www.learncpp.com/cpp-tutorial/94-overloading-the-comparison-operators/[/url] | |
Re: [QUOTE=Ancient Dragon]>>lblName->Click += gcnew System You do NOT use += in that line, just =.[/QUOTE] No disrespect, AD, but it is correct. += is overloaded for events (which are really delegates in disguise) so that you can chain more than one event handler to a single event. See [url]http://www.functionx.com/vccli/general/events.htm[/url] (about … | |
Re: Post the relevant portion first and then we can see if we need more information. | |
Re: Change the first if statement to [icode] if(screen == false) [/icode] or [icode] if(!screen)[/icode] and for the second one [icode] if(screen == true) [/icode] or [icode]if(screen) [/icode]. | |
Re: You could use .find() - see the examples at [url]http://www.cplusplus.com/reference/string/string/find/[/url] (there's an overload for a character to be matched) | |
Re: [quote]The problem is that this block of code cannot be placed in a function, and I don't want to copy/paste it twice.[/quote] Maybe I'm not reading that right, but what is your requirement for this block? And no, you can't assign a for loop to a variable. | |
Re: @Jason main() always returns an int according to the standard | |
Re: [quote]It compiles fine apart from this and I am not sure if somehow I've coded it wrong, although then it should have thrown up compile errors? (Lost)! [/quote] "Site web computer far opens" will pass your spell checker (and maybe even some grammar checkers) but it doesn't make much if … | |
Re: (In addition to most of the above...) ... I don't know if this was considered before, but how about a 10 second tutorial during registration? You could throw in how to mark the thread as solved, too. The SEO/marketing people might complain that they don't use code tags, but how … | |
Re: Isosceles triangles have 2 equal sides, equilateral triangles have 3 equal sides. Therefore, what can be said about equilateral triangles? Determine whether or not there is a relationship between right angle triangles and either of the other two. Write out your thoughts and someone will be able to tell you … | |
Re: Post your current code, no one is going to be able to help you if they can't see your errors. | |
Re: Where are ReadRec and DisplayRec? You've got the right idea, but .eof() isn't a good idea (see [url]http://www.daniweb.com/forums/post155265-18.html[/url]). Post your attempt at those methods and we'll help you with them. Also, you want [icode] if(!infile.is_open()) [/icode] on line 24. Fail() is for checking if the stream has received "bad" input. | |
Re: On line 5 there, you have the dereferencing operator ('*') on the wrong side. Presumably that line is dereferencing an iterator that's not listed... In the second listing, you need to pass the name of your [icode] std::vector<Obj*> [/icode] into your method (in the same way that you've passed the … | |
Re: If you look up [icode] mysql_query [/icode] it returns an int, 0 upon success and non-zero for failure. What do you want to print out from the query? | |
Re: *nix has Curses for the same purpose (and there are versions like pdcurses, pdcurses.sourceforge.net that are portable across systems). I looked at libconio and it seems to be poorly documented (presumably, and I don't like making these kinds of assumptions, but it probably has the same functions that conio does). … | |
Re: Since your numbers are single digits, take in your input as a character and check to see if it's a digit (the isdigit is meant for characters). See if you can rewrite the condition of your while loop to account for numbers in the right range (hint, look at an … | |
Re: It's looking for the function definitions of lines 39-41. Where are they implemented? | |
Re: Did you open your code in VS 2010 and it was created in VS 2008? That was what I found for the assertion error. You need to import your project so it is not dependent on the old DLLs. As far as the other functions go, please take a crack … | |
Re: [quote] I can show you the code I have so far.[/quote] Please do...there's no way to help you without it. | |
Re: Try instantiating a istringstream [code] istringstream iss(temp); //before line 7 if(!(iss >> e)) e = 0; [/code] | |
Re: At least attribute your source: [url]http://www.wsdstaff.net/~dslade/c++WebPage/Ch08/Ch08_Examples/Ch08_Exmp5/MagicSquare.html[/url] (your professor will appreciate it, too) | |
Re: Never used it, can't vouch for it, but take a look at [url]http://www.lumenvox.com/help/speechEngine/index.htm[/url] | |
Re: [url]http://www.kernel.org/[/url] has all of the Linux kernel source code. |
The End.