Search Results

Showing results 1 to 40 of 254
Search took 0.03 seconds.
Search: Posts Made By: WaltP ; Forum: C++ and child forums
Forum: C++ Oct 20th, 2009
Replies: 9
Views: 330
Posted By WaltP
Since you are using upperCase and lowerCase as character arrays rather than strings, you need to output each value individually.

If you want to use them as a string, you need to remember that as...
Forum: C++ Aug 2nd, 2009
Replies: 11
Views: 493
Posted By WaltP
Learn to Format your code (http://www.gidnetwork.com/b-38.html). That generally solves every bracket problem immediately.
Forum: C++ Jul 17th, 2009
Replies: 3
Views: 719
Posted By WaltP
There is no standard way to read characters like getch()
Forum: C++ Jul 14th, 2009
Replies: 8
Views: 343
Posted By WaltP
Another option is:

cout << "." << flush();
Forum: C++ Jul 2nd, 2009
Replies: 13
Solved: C++ arrays
Views: 526
Posted By WaltP
Don't you also have to delete each p array? :icon_wink:

If you aren't sure, the answer is yes, delete each array first before deleting p itself.
Forum: C++ Jun 29th, 2009
Replies: 10
Views: 774
Posted By WaltP
And are you still having problems? Are we supposed to use our psychic powers or would you like to explain fully what the problems are now?
Forum: C++ Jun 11th, 2009
Replies: 23
Views: 1,185
Posted By WaltP
Then stop replying posts you have no intention of of adding constructive responses to!

Adatapost, you do not have to use a jephthah-approved compiler.
Forum: C++ May 16th, 2009
Replies: 12
Solved: delimited file
Views: 819
Posted By WaltP
But you did get the CODE tags correct. The cplusplus part is optional.

Also, the PREVIEW button would show you if the tags are correct.
Forum: C++ May 7th, 2009
Replies: 4
Views: 707
Posted By WaltP
First thing you need to do is rethink the YEAR loop. Make it shorter. The leap year section in it makes the loop too complicated, and it's wrong. Don't deal with LY as a full year, it's one day.
...
Forum: C++ May 7th, 2009
Replies: 4
Views: 707
Posted By WaltP
You didn't tell us the most important thing about your program. What is happening to make you think it's weird?
Forum: C++ May 3rd, 2009
Replies: 4
Views: 1,037
Posted By WaltP
Agree with negative, disagree with base. Since it is a compiler-specific function, there is no 'official' definition. Therefore, adding base is simply a possible feature/addition. :icon_wink:
Forum: C++ Apr 26th, 2009
Replies: 25
Views: 1,722
Posted By WaltP
Exactly! What I said about malloc() in my first post goes for new too. STOP USING IT! Reread what I said.
Forum: C++ Apr 24th, 2009
Replies: 25
Views: 1,722
Posted By WaltP
OK, have a seat...
1) malloc() -- this will cause memory leaks on each call. Once the function returns, the memory address allocated is lost and can not be returned to the heap. Stick with the...
Forum: C++ Apr 23rd, 2009
Replies: 9
Views: 987
Posted By WaltP
I don't understand... Is there a problem with ctime?
Forum: C++ Apr 22nd, 2009
Replies: 16
Views: 720
Posted By WaltP
OK, fine. It's generally the last thing a professional programmer would do.

Peeking is generally used for OS level programming when you need to do things outside the ordinary. Reading the...
Forum: C++ Apr 22nd, 2009
Replies: 16
Views: 720
Posted By WaltP
My ghod! Don't use cin.peek()! Read the line as text and process it.
Forum: C++ Apr 22nd, 2009
Replies: 9
Views: 987
Posted By WaltP
Look at the header ctime. All the time functions are there. A Google search should give you definitions and explanations.
Forum: C++ Apr 21st, 2009
Replies: 16
Views: 720
Posted By WaltP
What integer is '|'? That looks like a character so you cannot read it into an int variable.

To do what you need you'll have to read the input as characters. If you get a number, convert it to...
Forum: C++ Apr 18th, 2009
Replies: 11
Views: 659
Posted By WaltP
You opened filein and you're reading from cin.
Forum: C++ Apr 7th, 2009
Replies: 8
Views: 538
Posted By WaltP
Because we already got our grades and passed the course. You can't pass using our work. You need to pass on your own work.
Forum: C++ Mar 23rd, 2009
Replies: 5
Views: 338
Posted By WaltP
Start by defining two arrays, first to hold the values and second to hold the vowels themselves. Then use loops to check the input characters with the letter array and increment the correct value in...
Forum: C++ Mar 14th, 2009
Replies: 3
Views: 348
Posted By WaltP
If menu() returns a value, then return the value. It should be a char, not void, function.
Forum: C++ Mar 4th, 2009
Replies: 4
Views: 277
Posted By WaltP
True. But based on the code you don't seem to need a string, just an array of characters. So
char chr_digits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
is the 'correct' definition.
Forum: C++ Jan 26th, 2009
Replies: 19
Views: 854
Posted By WaltP
You said the temperature in the file is in the format
C23.4
F74.7

Where did you read the C or F?
Where did you test the C of F to decide if you need to convert?
Forum: C++ Jan 24th, 2009
Replies: 11
Solved: Shuffle Cards
Views: 1,783
Posted By WaltP
Your shuffle seems backwards to me. Assuming card values mean something like
1 = 2 of clubs
2 = 3 of clubs
...
13 = A of clubs
14 = 2 of Diamonds
...
52 = A of Spades

I'd change the...
Forum: C++ Dec 14th, 2008
Replies: 15
Views: 1,055
Posted By WaltP
what do you mean xeuron?[/QUOTE]
Something you don't have to worry about. Use Dave's idea.

Also, read this (http://www.gidnetwork.com/b-57.html).
Forum: C++ Dec 14th, 2008
Replies: 4
Views: 607
Posted By WaltP
It also might help to tell us what the problem is and what you're trying to accomplish.

If this is the same problem as another thread, you should have just continued there.
Forum: C++ Dec 7th, 2008
Replies: 2
Views: 564
Posted By WaltP
After your cin >> choice; add code to read the rest of the input buffer to clear it out, up the and including the \n.

When you enter values, ALL characters you type are in the buffer, including...
Forum: C++ Nov 26th, 2008
Replies: 9
Views: 671
Posted By WaltP
I agree that you should not be using goto. And I have no idea why a while is precious, and longer.
I prefer the while() to the for() -- it's more logical to me.
The argument for the while() is a...
Forum: C++ Nov 26th, 2008
Replies: 15
Solved: readfile help
Views: 802
Posted By WaltP
Why is it people just say something without explanation? Why should they listen if there doesn't seem to be a reason?

Lerner is correct, and here's why (http://www.gidnetwork.com/b-58.html)....
Forum: C++ Nov 22nd, 2008
Replies: 10
Views: 906
Posted By WaltP
Sure. In general:

do
{
display menu
input MenuValue
process the menu entry selected
} while (MenuValue != ValueOfExitChoice);
Forum: C++ Nov 21st, 2008
Replies: 6
Views: 675
Posted By WaltP
I wouldn't do it. Flashing a message in different colors is one of the most obnoxious things you can do to a user IMO.
Forum: C++ Nov 18th, 2008
Replies: 13
Solved: Read File Issue
Views: 972
Posted By WaltP
I've looked at your post for about 5 minutes and have absolutely no idea what your question is about! OK, you're having a problem with a line. The line is only for reference -- whatever that means....
Forum: C++ Oct 16th, 2008
Replies: 18
Views: 1,643
Posted By WaltP
Where did you use the variable index to insert the variable insertItem into the array?
Forum: C++ Aug 18th, 2008
Replies: 7
Views: 1,040
Posted By WaltP
It actually did answer the question AD thought you asked. Which was more than I could do because to me your question doesn't make sense. What does the system() command have to do with the size of...
Forum: C++ Jul 26th, 2008
Replies: 3
Views: 666
Posted By WaltP
Where are you having the problem?
What does the program do wrong?
What makes it wrong?
What should it do instead?

When asking for help it's necessary to explain the problem, not just toss 3...
Forum: C++ May 31st, 2008
Replies: 2
Views: 1,022
Posted By WaltP
You cannot compare character strings in this manner. You need to use one of the string functions.

You probably want if ( strcmp(argv[1], "e") == 0 )
Forum: C++ May 13th, 2008
Replies: 7
Views: 871
Posted By WaltP
Yes, you're off. You have to test each character individually. Something along the lines of
if ((n < 5) || (n == 10))
which is TRUE if n is 4 or less OR equal to 10
Forum: C++ May 13th, 2008
Replies: 8
Views: 929
Posted By WaltP
Or add output statements to display values as the program runs with the location within the program.
Forum: C++ Apr 8th, 2008
Replies: 6
Views: 607
Posted By WaltP
First, get rid of the clear screen stuff since you cannot make it portable and is not part of standard C++
Second, get rid of the GOTO statement and use a while loop instead
Third, you say you want...
Showing results 1 to 40 of 254

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC