Forum: C++ Oct 20th, 2009 |
| Replies: 9 Views: 330 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 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 There is no standard way to read characters like getch() |
Forum: C++ Jul 14th, 2009 |
| Replies: 8 Views: 343 Another option is:
cout << "." << flush(); |
Forum: C++ Jul 2nd, 2009 |
| Replies: 13 Views: 526 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 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 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 Views: 819 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 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 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 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 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 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 I don't understand... Is there a problem with ctime? |
Forum: C++ Apr 22nd, 2009 |
| Replies: 16 Views: 720 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 My ghod! Don't use cin.peek()! Read the line as text and process it. |
Forum: C++ Apr 22nd, 2009 |
| Replies: 9 Views: 987 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 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 You opened filein and you're reading from cin. |
Forum: C++ Apr 7th, 2009 |
| Replies: 8 Views: 538 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 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 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 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 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 Views: 1,783 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 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 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 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 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 Views: 802 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 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 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 Views: 972 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 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 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 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 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 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 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 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... |