Search Results

Showing results 1 to 40 of 1000
Search took 0.08 seconds.
Search: Posts Made By: WaltP ; Forum: C++ and child forums
Forum: C++ 6 Days Ago
Replies: 8
Solved: LIFE problems
Views: 194
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: 4
Views: 376
Posted By WaltP
Yes we can help you, but you must post code for us to help with. Read the Rules and the important sticky posts for info.
Forum: C++ Oct 20th, 2009
Replies: 9
Views: 337
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 20th, 2009
Replies: 10
Views: 332
Posted By WaltP
Wouldn't it be helpful to us that aren't psychic to actually explain the problem? I assume you are having trouble compiling.
Forum: C++ Oct 18th, 2009
Replies: 3
Views: 222
Posted By WaltP
Start by doing 1a which is very basic and quite simple. Then start adding the code for 1b. When you get stuck actually coding, we can help you overcome those problems. But you have to code...
Forum: C++ Oct 18th, 2009
Replies: 3
Views: 225
Posted By WaltP
All you do is set valid to false at the beginning, never change it anywhere else in the code.

Think again -- what is the exit condition you need for the while and do-while loops.
Forum: C++ Oct 18th, 2009
Replies: 5
Views: 395
Posted By WaltP
Sorry. I didn't see that code because it didn't make sense to me at the end, and in that form. It's best at the beginning of the loop in this case.
Forum: C++ Oct 16th, 2009
Replies: 5
Views: 395
Posted By WaltP
It also never gets a new number. The line
guessNumber = rand() % 100 + 1;
Needs to be inside the loop.
Forum: C++ Oct 15th, 2009
Replies: 7
Views: 390
Posted By WaltP
You need to use a loop and divide the number n by each odd number from 3 to n/2. If any number divides n evenly (no remainder) n is not prime.
Forum: C++ Oct 14th, 2009
Replies: 5
Views: 660
Posted By WaltP
If you want to know how a program works, plzzzzzzzzzzzz post a program. Or try reading the Rules for the site.
Forum: C++ Oct 14th, 2009
Replies: 2
Views: 304
Posted By WaltP
If you can't give us any more information than just posting almost 200 lines of uncommented code with no indication what's wrong, where it's wrong, and not using CODE tags, then there's no real help...
Forum: C++ Oct 14th, 2009
Replies: 3
Views: 184
Posted By WaltP
First of all, format your code (http://www.gidnetwork.com/b-38.html) so it can be followed.
This code:
m = ~(arrX[I]);//convert to unsigned
m == m+1;
does not convert to unsigned. m == m+1; is a...
Forum: C++ Oct 12th, 2009
Replies: 1
Views: 188
Posted By WaltP
Since doubles are rarely exact, probably your loop counter is wrong. For example when you think i=4 it's probably i=3.9999902 or something like that.
Forum: C++ Oct 11th, 2009
Replies: 3
Views: 296
Posted By WaltP
The rename() function renames, does not copy. You need to open 2 files: the original file for reading, the new file for writing. Then read the old file and write to the new file.
Forum: C++ Oct 4th, 2009
Replies: 5
Views: 377
Posted By WaltP
for(i=loc;i>=first;i--)
{
if(sorted_array[i] != key)
first=loc-1;
}

A while loop would be better here...


if(key=sorted_array[first])
Forum: C++ Oct 3rd, 2009
Replies: 2
Views: 276
Posted By WaltP
Yes, be consistent with your input. Always use getline() and you shouldn't have to worry about cin.ignore()
Forum: C++ Aug 7th, 2009
Replies: 4
Views: 364
Posted By WaltP
Yes, but if set to spaces, pressing the TAB key can add 4 spaces which makes code much easier to read. And when posted here, where tabs are always screwy, helps us read your code.
Forum: C++ Aug 2nd, 2009
Replies: 5
Views: 307
Posted By WaltP
If this is true, what does the statement
100 100;

do? (first statement)
What does
happy + 20;

do?

All I see are compiler errors.
Forum: C++ Aug 2nd, 2009
Replies: 11
Views: 512
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 1st, 2009
Replies: 3
Views: 266
Posted By WaltP
Since it's a text box, just look at every character in the box and remember the index of each 2 you come across.
Forum: C++ Jul 29th, 2009
Replies: 3
Views: 282
Posted By WaltP
What statement causes the error? Do you really expect us to search through 200 lines of code we didn't write to find an error that is unknown?

Please give us enough details to help you.
Forum: C++ Jul 28th, 2009
Replies: 8
Views: 1,737
Posted By WaltP
gurdeep kaur, how does your post help Lenny19 with his problem? Or do you have a new question which needs to be asked in it's own thread?

Before starting your thread, read some of the posts that...
Forum: C++ Jul 28th, 2009
Replies: 3
Views: 328
Posted By WaltP
Has the book been released in ebook form? Did you search for it?
Forum: C++ Jul 26th, 2009
Replies: 3
Views: 322
Posted By WaltP
Sure. I added the CODE TAGS you ignored, which are described
1) in the Rules (http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies) you were asked to read when you registered
2) in...
Forum: C++ Jul 23rd, 2009
Replies: 3
Views: 169
Posted By WaltP
If usually starts with headers, then int main(). Then there's an input of some kind.
Then you get some if statements with some math intermixed, maybe even a loop or three, and finally some output...
Forum: C++ Jul 21st, 2009
Replies: 27
Views: 133,164
Posted By WaltP
@guru_boy:

You didn't bother reading the thread before posting eh?
Forum: C++ Jul 17th, 2009
Replies: 3
Views: 763
Posted By WaltP
There is no standard way to read characters like getch()
Forum: C++ Jul 16th, 2009
Replies: 9
Views: 359
Posted By WaltP
Since we know the program you posted cannot possibly compile, and you claim it's actually running, you need to repost the current code you're compiling. And then explain in detail what the program...
Forum: C++ Jul 14th, 2009
Replies: 8
Views: 346
Posted By WaltP
Another option is:

cout << "." << flush();
Forum: C++ Jul 11th, 2009
Replies: 11
Views: 692
Posted By WaltP
kbhit() is useful, but using getch() is also required. Understand what both functions do, and you should be able to figure out how to use them for your program.
Forum: C++ Jul 2nd, 2009
Replies: 13
Solved: C++ arrays
Views: 533
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: 5
Views: 276
Posted By WaltP
You're welcome.

Read the rules.

Including the use of u for you, no for know, etc.
Forum: C++ Jun 29th, 2009
Replies: 10
Views: 793
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 27th, 2009
Replies: 4
Views: 387
Posted By WaltP
atoi() is portable
itoa() is not
Forum: C++ Jun 24th, 2009
Replies: 3
Views: 879
Posted By WaltP
You probably blew past your buffer and started writing to memory you should not have written to.
Forum: C++ Jun 24th, 2009
Replies: 4
Views: 1,390
Posted By WaltP
If the OP wants the value 49, this will work. I think the OP might want the value 1 so subtract 48 from val afterwards. But then again, he might mean something completely different.

Please...
Forum: C++ Jun 24th, 2009
Replies: 6
Views: 659
Posted By WaltP
Write a function that searches the buffer.
Forum: C++ Jun 24th, 2009
Replies: 6
Views: 348
Posted By WaltP
Smart decision. At least your teacher knows what the program is supposed to do and can ask the questions needed to help you.
Forum: C++ Jun 24th, 2009
Replies: 5
Views: 402
Posted By WaltP
So is:
1) posting code the OP should be writing
2) posting code that is not formatted

Please do not post answers to questions. This forum is not a homework service. And that service should...
Forum: C++ Jun 23rd, 2009
Replies: 6
Views: 659
Posted By WaltP
Binary files have binary information, not text information. Therefore, string functions probably will not be effective on the buffer. There are probably NULL characters in the binary data which...
Showing results 1 to 40 of 1000

 


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

©2003 - 2009 DaniWeb® LLC