2,045 Posted Topics
Re: Which component is giving you the most trouble? The instructions seem to be a good starting point. Try to implement at least some portion of it (class, two constructors, etc.) and post your code and someone will help. | |
Re: Please be more specific about the nature of your difficulty. Please post your code. | |
Re: Dev is outdated, comes with an older version of gcc, and is no longer in development. Try Code::Blocks it definitely has that feature you are looking for. Eclipse has it too, I believe. | |
Re: I can't directly answer your question, but there are programs available that do similar things like wix ([url]http://wix.sourceforge.net[/url]). I've never used it (as usual), but it seems very extensible. | |
Re: For starters, I would try rewriting it in a more conventional way, you'll probably understand it better. Think about the open square as a line at the top row and bottom row, and one square in the first and one in the last column for all other rows. This way … | |
Re: The order you process the numbers in is important, you have to be taking out multiples of the smaller number from the larger one. A few if statements should correct the problem. | |
Re: There must be a critical file missing from your install. Can you try reinstalling it? Really you're probably much better off getting MingW (the windows port of gcc) with Code::Blocks) or one of the Visual C++ Express Editions. | |
Re: [quote]But the thing is if i can do it in java i can do it in C and C++ [/quote] Have a go at it and we'll help you. Some folks speak Java, but it's been a while for others. Rather than take up the time of someone in the … | |
Re: "nod" is declared in your constructor which means it is a local variable, and is destroyed once the constructor completes. Declare "nod" as a private member variable, and then you can initialize it in the constructor as you have. | |
Re: Where are M,T,W,H, etc. declared, and what are their types? | |
Re: For line 140, you want [icode] is_open() [/icode] for sure. EDIT: Also, the g in seekg is for "get pointer," which belongs with ifstream only. The corresponding functions end in p for the ofstream. (see [url]http://www.cplusplus.com/reference/iostream/ofstream/[/url] midpage). | |
Re: Try Googling those terms. It's been a while since you've posted, but I remember you were going through similar things before. Find the simplest example that does what you want and emulate it in a short test program (3-5 lines) and then integrate it into your work. | |
![]() | Re: Can you make a loop that will count 1, 3, 5, etc.? Use that. I'm not sure what the e means either. Do you have an actual value for s? Perhaps you are supposed to stop adding terms when you are within 0.1 of the value of s. |
Re: I'm not sure I understand what you are trying to accomplish. You're reading in the names as std::strings into Name, but then you don't do anything else with it. You've got a colon after Name on line 29, so that's probably why it's getting stuck (colons can indicate a label … | |
Re: int[B]t[/B]obin is spelled incorrectly on line 25. Remove line 72, the redeclaration of n is masking your function parameter n. | |
Re: Plan out what you need to do on paper first. As a start, you should be taking care of part 2 all at the same time instead of in a separate loop. March along your num array, when you come upon a number, see if it's in dist, if not … | |
Re: See if something like this [url]http://www.cplusplus.com/reference/clibrary/cstdlib/strtol/[/url] will help you at all. You can use the fact that it doesn't convert if there is no valid number there to your advantage (and just account for the negative values [I]post hoc[/I]) | |
Re: Here's an example of one in C++/CLI (so if you were to create a WinForms application in VC++) [url]http://www.speakcomputers.com/Windows-Forms-Programming/C-PlusPlus/TreeView.aspx[/url] Otherwise, you need to come to us with something, as there are a bunch of tutorials out there. Make some decisions about your implementation at least (e.g. Win32 API vs. .NET … | |
Re: Both find() and size() return an item of datatype "size_t," which means what it actually returns is defined from system to system, but normally is an unsigned int. Make i and pos of type size_t. For next time, please list what the warning is so someone doesn't have to guess. | |
Re: Within main, call getSize() and after that use the 2 values to establish the dynamic arrays in main(). Pass the arrays and the sizes into createArrays, and initialize them to zero there. Then pass the arrays and sizes into fillArrays. | |
Re: Your problem is in line 34. Say there are 10 students, so on the line before you set aside an array of 10 (which has indexes from 0 to 9). So next you are trying to create an array at student[10].test, which doesn't exist. You must have a loop going … | |
Re: It's on line 9. [B]0.5[/B] is considered a double. Change line 9 to [icode]area = static_cast<float>(0.5*sum); [/icode] to tell the compiler that's what you mean to do (or use a C style cast like [icode]area = (float)(0.5*sum);[/icode]) | |
Re: The first is a preprocessor directive, before the compiler compiles your code, it will go through and replace sum with 1. The second declares a variable in memory to hold that quantity. I'm sure it can be argued as to which is best, but the "const int" is probably more … | |
Re: num1 only exists within the scope of main, you must pass it into your function to use it. I have been reading your posts and I think that you are missing some fundamental ideas. If you have a textbook, go back and reread the appropriate sections, as your misperceptions are … | |
Re: "lastfile" and "lastFile" are two different identifiers | |
Re: Modify the constructor of form2 to take a form1 object. Assign that to a private form object in your form2. Operate on it like you would any other object. | |
Re: [code] [100 | 95 | 85 | 50 | 91] //read into this int array (show here illustratively) //use a function to translate (your if/else construct goes here) ['A' | 'A' | 'B' | 'F' | 'A'] //your new array [/code] A char array is just an array of characters, … | |
Re: Use a loop check to see if a given value in the array matches the data you are looking for (or meets a certain criterion). Then set that value to zero or something appropriate to that particular array (so if it's a string array, set it to space or something. | |
Re: [QUOTE=Lasbunter]Please share here what you know about that ,, :)[/QUOTE] Please feel free to do the same! Please post the code you are having trouble with or at least a rough pseudocode outline of what you think should be included to start. | |
Re: Pass in numusers to ReadAllUsers by reference. Change lines 14 and 33 and add an & between int and numusers. The way you have it now, numusers is uninitialized in main, so you send garbage into ReadAllUsers, which only changes [I]a copy of it[/I] to a value, but the one … | |
Re: Never done it but there's plenty of documentation out there: [url]http://stackoverflow.com/questions/145270/calling-c-c-from-python[/url] seems to be loaded with information. Try searching the Python forum here too, but don't double post your thread, ask for it to be moved (click 'Flag Bad Post') if you think your question is better suited over on … | |
Re: It shouldn't have compiled, you declare sizeOfArray after you try to use it. Take that value in before you instantiate a string array. See what I wrote in your other post too, you have a bunch of uninitialized pointers declared at the top of your code which are going to … | |
Re: I compiled it and did not get that warning, as it seems you have initialized it properly. There are a host of other errors. Does line 77 look right to you? There are 6 more errors like that. Someone had pointed that out in an earlier post. Also, for example, … | |
Re: See your other post. It indicates a pure virtual function, which automatically designates your class as abstract. | |
Re: Review in your text the distinction between char * and string * -- I think you are very confused. Also, you are reading into a bunch of uninitialized pointers. Yikes. | |
Re: [icode] virtual void clear()=0; [/icode] makes your class abstract (as it is a pure virtual function). You must inherit from your class to use it. BTW, you don't have to specify "public" as an access specifier in a struct, line 9, as structs have a default public access to all … | |
Re: [QUOTE=geojia]Edit: NVM your problem isn't the c_str(), userInput is already char. [CODE] strcpy (cstr, userInput); [/CODE][/QUOTE] userInput is a [icode] string * [/icode] which means you have to dereference it using the -> operator, so [icode] userInput->c_str() [/icode] @OP You still will need to include [icode] <string> [/icode] if you … | |
Re: Just an aside, you shouldn't use .fail(), use .is_open() .fail() is for checking when a stream reads something it wasn't supposed to (like trying to read a string into an integer). There's one way to find out exactly where your program is failing, run it in a debugger and single … | |
Re: In the second listing, get rid of line 7 and wrap the code from 10 to 81 in [code] namespace SALES { } [/code] You need to specify that all of that is in the same namespace as your header file declarations. There's a bug with one of the array … | |
Re: Something like [url]http://www.mpir.org/[/url] (or [url]http://gmplib.org/[/url] if you're on *nix). Check the documentation for the largest number allowed, as 500! may far exceed it. Remember that 500! is a monstrous number! Check to make sure your assignment isn't to approximate it somehow. | |
Re: 2 things to note: There's a relationship between the number being read in and the desired index of the string vector. When you are erasing on line 43, you are changing the vector's size, which affects your counter. I'm sure you've had iterators in class too... | |
Re: [quote]and the worst is that they gave us this task before explaining the functions[/quote] I'm sure there are on the order of 10^23 pages online about functions and you probably have a textbook. This is my interpretation: [code] string dec2bin(int decimal); //prototype int main() { //input a number "num" here … | |
Happy Thanksgiving! This is a minor annoyance, but it's happened to me 3 times in 2 days so I figured I'd letcha know. I'm using Chrome 7.0.517.44 and when I've gotten a PM, the screen goes "dark" (as usual) but no dialog pops up and the browser gets stuck (I … | |
Re: Hint: what would be a good name for a method that returns the size of an item? (there are two options for string actually). Put Google to work for you. | |
Re: <Sorry, misunderstood the question.> | |
Re: Well, what have you come up with so far? Please show some effort. | |
Re: Talk yourself through what steps you have to go through to work the queue (enqueuing and dequeuing). Think about the elements of the array. What steps have to happen after you remove the first element if the queue is built on an array model? Reread your text's section on big … | |
Re: No one is going to give you the source code, that's unreasonable to ask as it is [B]your[/B] project. Break this down into smaller tasks and plan out what you need to do for each one. | |
Re: You need to be specific about what the issues are. As the great (moderator) WaltP will tell you, "we're not mind readers." | |
Re: You probably don't need system if it's a GUI application, as clicking the button to display hello world shouldn't close the window unless you explicitly tell it to. |
The End.