Search Results

Showing results 1 to 40 of 435
Search took 0.04 seconds.
Search: Posts Made By: WaltP
Forum: C++ 1 Day Ago
Replies: 8
Solved: LIFE problems
Views: 142
Posted By WaltP
Display each grid you generate and see where the errors occur in the generations.

Are you taking into account that the edged of the grid only have 5 neighbors and not 8?
Forum: C++ Oct 20th, 2009
Replies: 9
Views: 332
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 Oct 15th, 2009
Replies: 3
Views: 400
Posted By WaltP
Let's see...
No CODE tags, even thought there are at least 6 places they are explained, and 3 of them on the main page alone.
No explanation about why code was posted
I guess all there is to say...
Forum: C Oct 14th, 2009
Replies: 4
Views: 290
Posted By WaltP
Look into the modulus (%) operator.
Forum: C++ Aug 2nd, 2009
Replies: 11
Views: 494
Posted By WaltP
Learn to Format your code (http://www.gidnetwork.com/b-38.html). That generally solves every bracket problem immediately.
Forum: C Aug 2nd, 2009
Replies: 34
Views: 1,253
Posted By WaltP
weird is not an approved IT term. Be specific. Give details. What is the first question your mechanic would ask if you told him "my car is acting weird?"
Forum: C Aug 1st, 2009
Replies: 10
Views: 723
Posted By WaltP
NEVER use void main() (http://www.gidnetwork.com/b-66.html)
Forum: C Jul 28th, 2009
Replies: 3
Views: 361
Posted By WaltP
You have a ; you don't want at the end of the while statement:

while ((c = getchar())!=EOF);
if(islower(c)){
++letter[c-'a'];}
Forum: C Jul 23rd, 2009
Replies: 7
Views: 543
Posted By WaltP
Code tags explained:
1) in the Rules (http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies) you were asked to read when you registered
2) in the text at the top of this forum
3) in...
Forum: C++ Jul 17th, 2009
Replies: 3
Views: 732
Posted By WaltP
There is no standard way to read characters like getch()
Forum: C++ Jul 14th, 2009
Replies: 8
Views: 345
Posted By WaltP
Another option is:

cout << "." << flush();
Forum: C++ Jul 2nd, 2009
Replies: 13
Solved: C++ arrays
Views: 529
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 Jul 2nd, 2009
Replies: 21
Views: 1,206
Posted By WaltP
Enough, people. The facts are
1) fixed code should not have been posted by anyone other than the OP
2) fixed code should not have been improved by anyone unless the OP posted correct code in the...
Forum: C Jun 29th, 2009
Replies: 7
Views: 451
Posted By WaltP
you did much better than 95% of the new posters that can't be bothered to understand the forum before posting. :)


Simply output a newline after the six values - \n


Not sure what you mean --...
Forum: C++ Jun 29th, 2009
Replies: 10
Views: 776
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 29th, 2009
Replies: 4
Views: 549
Posted By WaltP
Your 1st half of the array array[x][0] is never initialized to zero so the values start out with garbage.
Forum: C++ Jun 11th, 2009
Replies: 23
Views: 1,199
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 Jun 7th, 2009
Replies: 18
Views: 865
Posted By WaltP
Load 19 random values. If a 0 is generated during these 19 values, remember that fact.

For the 20th value, if a 0 was not generated, load a 0, otherwise get one more random number.
Forum: DaniWeb Community Feedback May 29th, 2009
Replies: 17
Views: 1,487
Posted By WaltP
So do I. For people like Jen0608 with 170+ posts, it's easy to make the required number of posts in one sitting to get to the sig limit.
Forum: C May 28th, 2009
Replies: 13
Views: 996
Posted By WaltP
Consider this loop:

for (i = 0; i < 5000; i++)
{
sprintf(ifile, "file%04d.dat", i);
sprintf(ofile, "output%04d.dat", i);
//process the files
}
Forum: DaniWeb Community Feedback May 16th, 2009
Replies: 4
Views: 812
Posted By WaltP
Actually, FC did not bump a really old thead. NetworkExpert did. He just tried to help out what he saw was a current thread.
Forum: C++ May 16th, 2009
Replies: 12
Solved: delimited file
Views: 822
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: DaniWeb Community Feedback May 9th, 2009
Replies: 12
Views: 1,184
Posted By WaltP
You don't care about the girls? :icon_smile:
Forum: C++ May 7th, 2009
Replies: 4
Views: 713
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: 713
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,048
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 May 3rd, 2009
Replies: 5
Views: 667
Posted By WaltP
When you finish reading a line, you are automatically ready to read the next line. So just start reading again and there you are!
Forum: C May 1st, 2009
Replies: 5
Views: 667
Posted By WaltP
Read the rest of the current line.
Forum: DaniWeb Community Feedback Apr 27th, 2009
Replies: 3
Views: 554
Posted By WaltP
Green adds points to reputation.
Red subtracts.
Grey, no change to rep points. It's because the person that gives rep doesn't have enough posts that actually affect someone's rep.
Forum: C Apr 26th, 2009
Replies: 6
Views: 1,507
Posted By WaltP
1: Zero your Total
2: Read the input as a string (hex)
3: Check each character and conve rt it into decimal value (A=10, B=11, etc)
4: Multiply Total by 16 and add the above value
5: Back to 2
Forum: C++ Apr 26th, 2009
Replies: 25
Views: 1,729
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 25th, 2009
Replies: 27
Solved: Average/max/min
Views: 1,798
Posted By WaltP
Yes. See this (http://www.gidnetwork.com/b-62.html) and this (http://www.gidnetwork.com/b-56.html). Stop using gets()!



Then write C++ instead of C. If you want to write C code you must...
Forum: C++ Apr 24th, 2009
Replies: 25
Views: 1,729
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: 998
Posted By WaltP
I don't understand... Is there a problem with ctime?
Forum: C++ Apr 22nd, 2009
Replies: 16
Views: 728
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: 728
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: 998
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: 728
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 18th, 2009
Replies: 27
Solved: Average/max/min
Views: 1,798
Posted By WaltP
If you don't know what index = 0; you seriously need to start reading your book before continuing. I suggest you talk to your instructor...
Showing results 1 to 40 of 435

 


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

©2003 - 2009 DaniWeb® LLC