Search Results

Showing results 1 to 22 of 22
Search took 0.01 seconds.
Search: Posts Made By: dwks
Forum: C++ Sep 3rd, 2009
Replies: 4
Views: 300
Posted By dwks
Yes, new members register at an astonishing rate here . . . when I logged in there were six less members than there are now. :)


[Sorry if this is a bit advanced. I assume you're a pretty good...
Forum: C Aug 31st, 2009
Replies: 2
Views: 210
Posted By dwks
You can't assign anything inside a structure declaration. A structure declaration just defines a type. It's like a blueprint; you're telling the compiler, "if I ask you to create a Something, this is...
Forum: C++ Jun 8th, 2009
Replies: 5
Views: 264
Posted By dwks
I've really told you all you need to know. I'll give you some more details, but you'll have to do some searching . . . .

Three steps.

Open the file. You use ifstream to do this, it's not hard....
Forum: C++ Jul 24th, 2008
Replies: 10
Views: 1,009
Posted By dwks
switch (choice)
{
case '1':
saveGame();
case '2':
switch (missionNumber)
{
case 1:
...
Forum: C Jul 22nd, 2008
Replies: 2
Views: 506
Posted By dwks
You could save the numbers as you find them instead of printing them, say in a char array, and then print that array in reverse. On the other hand, it would probably be better to use a different...
Forum: C++ Jul 16th, 2008
Replies: 8
Solved: Alignement
Views: 790
Posted By dwks
So your question is, why does structure alignment apply to the last member of a structure?

I think the answer is the same as for why structure alignment exists in the first place. Structure...
Forum: C Jul 16th, 2008
Replies: 10
Views: 946
Posted By dwks
GCC doesn't like your code.
sort.c: In function ‘read_list’:
sort.c:13: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘int *’
sort.c: In function ‘insert_sort’:
sort.c:75:...
Forum: C++ Jul 2nd, 2008
Replies: 4
Views: 591
Posted By dwks
In order to use the ifstream fin variable that you declare inside the switch statement, you need to declare it outside the switch statement. For example:
ifstream fin;
switch(choose) {
case 1:
...
Forum: C Oct 20th, 2007
Replies: 6
Views: 1,439
Posted By dwks
gotoxy() is an ancient Borland function. It's very unportable. No new code should use it or anything from <conio.h>, such as getch() or clrscr().


'a' is a single character. "a" is a string. Use...
Forum: C Oct 13th, 2007
Replies: 9
Views: 1,031
Posted By dwks
It recommends Miracle C! . . . Miracle C is a very broken compiler, a very bad thing to recommend to new programmers.
Forum: C May 31st, 2007
Replies: 6
Views: 8,620
Posted By dwks
Also see this FAQ: http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1048865140&id=1043284351
Forum: C++ Feb 14th, 2007
Replies: 3
Views: 2,847
Posted By dwks
Really? . . . http://eternallyconfuzzled.com/arts/jsw_art_rand.aspx

Either way works, and some would recommend the OP's way over yours (myself included).

If you want it to generate numbers...
Forum: C++ Sep 17th, 2006
Replies: 4
Views: 1,504
Posted By dwks
basetsd.h isn't a standard header file, as you can find out by googling it. Therefore dropping the .h wouldn't help much; only the standard C++ header files have no extension. Of course, you're free...
Forum: C++ Sep 17th, 2006
Replies: 5
Views: 1,508
Posted By dwks
#include < IOSTREAM >
Header files are case-sensitive, and those spaces are part of the name, too. Use this instead:
#include <iostream>
Then change
cout<<**weekdays;
to
std::cout<<**weekdays;...
Forum: C Sep 14th, 2006
Replies: 50
Views: 8,324
Posted By dwks
As andor mentioned:
Why not to use fflush(stdin): FAQ > Explanations of... > Why fflush(stdin) is wrong (http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1052863818&id=1043284351)
What to...
Forum: C++ Sep 14th, 2006
Replies: 4
Views: 1,641
Posted By dwks
From http://www.wcscnet.com/Products/CdrvPP/CdrvPPSupportQuestions%5B0001%5D.htm
Forum: C Sep 14th, 2006
Replies: 9
Views: 1,774
Posted By dwks
This page covers it a bit more thoroughly: http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1047673478&id=1043284351
Forum: C++ Sep 14th, 2006
Replies: 4
Views: 11,479
Posted By dwks
I imagine the overhead would not be great (unless your program is written in C++); TC fits on four floppy disks and it runs on an XT computer. But switching to an old compiler just so you can use its...
Forum: C++ Sep 2nd, 2006
Replies: 4
Views: 3,746
Posted By dwks
Your acceptInput() code doesn't have access to arraySize. :)
Forum: C Aug 10th, 2006
Replies: 5
Views: 10,513
Posted By dwks
(source[pos] >= '0' && source[pos] <= '9')
Look into isdigit() in <ctype.h>. And isalpha() or isupper()+islower() for the other lines nearby.

Have you every used getenv() before? . . . if not,...
Forum: C++ Mar 11th, 2006
Replies: 47
Views: 65,416
Posted By dwks
for( int i = 0; i < 32; ++i )
That's not very portable. Use something in <climits> or the C++ equivalent.
Forum: C++ Feb 9th, 2006
Replies: 3
Views: 901
Posted By dwks
Try this:
Node array[DEPTH][ROW][COL] = {{{NULL}}};
That should get rid of your error and your warning.
Showing results 1 to 22 of 22

 


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

©2003 - 2009 DaniWeb® LLC