- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 2
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
16 Posted Topics
The position and visibility of the image element is dynamically updated. The following code displays the correct dimensions in Firefox 3.0.10 and Chrome 1.0.154.65, but displays "0,0" in IE8. [code] var _img = document.getElementById("imageElementId"); alert(_img.width + ", " + _img.height); [/code] Any ideas on how to get it to work … | |
Re: [QUOTE=JAGgededgeOB172;782629] [code] while(!inFile.eof() && i <= max) { getline(inFile, resident[i]->name); getline(inFile, mySSN); resident[i]->SSN = atol(mySSN.c_str()); getline(inFile, myage); resident[i]->age = atoi(myage.c_str()); getline(inFile, resident[i]->address); getline(inFile, skip); i++; } [/code][/QUOTE] I think you need to set resident[i-1]->next in here somewhere. | |
Hi all. I wanted to run this class by some experienced programmers to see if I have any obvious errors and to get any advice otherwise. I created a test suite and everything seems to function properly so I'm interested in feedback on overall class design, choice of data types, … | |
Re: My favoritest book has been C++ : how to program / H.M. Deitel, P.J. Deitel. | |
Re: Check your curly braces {}... if you have more than one line of code to run within an [icode]if[/icode] or [icode]else[/icode], the code must be enclosed in [icode]{}[/icode]. It is good practice to always use these, even if you have a single line of code to run. | |
Running 64-bit Fedora 8 on HP laptop with AMD Turion 64bit/dual core, developing in Eclipse, compiling with g++. The [icode]clock();[/icode] function always returns 0. Any ideas why this is so? I have had no problems using the rest of the [icode]ctime[/icode] library. [code=cpp] #include <ctime> using std::clock; #include <iostream> using … | |
Re: I came up with these helper functions to convert a name to a number. Even with different capitalization, the same name will be the same number each time. You can then add these numbers together and use the result to seed the random number generator or use the numbers in … | |
Re: For your utility to create the text files, I think you're excluding 'z', you might have to expand your [icode]rand()[/icode] function a little. You don't need to bother with the stack in your file creation utility either, since you pop immediately after pushing, you can save 2 steps and just … | |
Re: Take a look at this statement, what is it doing and what do you want it to do? [icode]s[b]=test[c];[/icode]. Also, what is the value of [icode]b[/icode] the first time through the loop? | |
Re: This looks like the formula for a recursive procedure, which is a procedure that calls itself. You have to be careful with recursive procedures because you risk going into an endless (until you run out of memory) loop -- unless you make sure you have an exit condition -- your … | |
![]() | Re: you'll have to keep track of how many items are in the array, will be 0 when empty. Will add one when you Insert and subtract one when you Remove or Erase. Plus you already created the empty array when declaring it under the private section. ![]() |
Re: The way it is now, you effectively set [icode]j=0[/icode], then test [icode]if( 0 <= j && j < size )[/icode], which will always be true, since j will always be 0 at this point. You didn't need to add a new variable(j), you should just not alter the user input … | |
Re: Do you use [icode]input[/icode] somewhere else in the top part of your code, like to display what value was converted? If so, then you should leave it as a parameter to your conversion functions. Also looks like you call [icode]p2e()[/icode] in both cases, should probably be calling [icode]e2p()[/icode] when [icode]choise … | |
Re: To answer your question... it is not working because (in your current design) when you say [icode]cin>> *sName;[/icode] it is the same as saying [icode]cin>> sName[0];[/icode]. The effect is overwriting the first person in the list each time you call [icode]newItem();[/icode] The quick fix for that problem in your current … |