Forum: C++ Sep 3rd, 2009 |
| Replies: 4 Views: 300 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 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 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 switch (choice)
{
case '1':
saveGame();
case '2':
switch (missionNumber)
{
case 1:
... |
Forum: C Jul 22nd, 2008 |
| Replies: 2 Views: 506 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 Views: 790 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 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 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 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 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 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 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 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 #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 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 From http://www.wcscnet.com/Products/CdrvPP/CdrvPPSupportQuestions%5B0001%5D.htm |
Forum: C Sep 14th, 2006 |
| Replies: 9 Views: 1,774 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 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 Your acceptInput() code doesn't have access to arraySize. :) |
Forum: C Aug 10th, 2006 |
| Replies: 5 Views: 10,513 (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 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 Try this:
Node array[DEPTH][ROW][COL] = {{{NULL}}};
That should get rid of your error and your warning. |