![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 | |
|
Expert Programmer
Join Date: Sep 2004
Location: Ontario, Canada
Posts: 555
Rep Power: 5
![]() |
Quote:
__________________
Johnny was a chemist's son but Johnny is no more, for what Johnny thought was H2O was H2SO4 |
|
|
|
|
|
|
#12 |
|
Programmer
Join Date: Mar 2005
Location: Lubbock, TX
Posts: 30
Rep Power: 0
![]() |
well i've tried all these ways, and it still immediately closes, and i really dont want to open it up through cmd.exe
|
|
|
|
|
|
#13 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
Post the code.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
|
#14 |
|
Programmer
Join Date: Mar 2005
Location: Lubbock, TX
Posts: 30
Rep Power: 0
![]() |
solved
I'm really glad you asked me to put the code, because it now is working, even though i had that blasted getchar(); in there, heres the code still if you could figure out why it mighta done it:
#include <stdio.h>
int main()
{
char a,b,c,d,e;
int aa,bb,cc,dd,ee;
printf("Press Enter");
getchar();
for(aa=0;aa<=2000;aa++)
{
for(a='A';a<='Z';a++)
{
printf("%c\n",a);
}
a='D';
}
for(bb=0;bb<=2000;bb++)
{
for(b='a';b<='z';b++)
{
printf("%c%c\n",a,b);
}
b='a';
}
for(cc=0;cc<=2000;cc++)
{
for(c='a';c<='z';c++)
{
printf("%c%c%c\n",a,b,c);
}
c='v';
}
for(dd=0;dd<=2000;dd++)
{
for(d='a';d<='z';d++)
{
printf("%c%c%c%c\n",a,b,c,d);
}
d='i';
}
for(ee=0;ee<=1985;ee++)
{
if(ee<=1985)
{
for(e='a';e<='z';e++)
{
printf("%c%c%c%c%c\n",a,b,c,d,e);
}
}
if(ee==1985)
{
for(e='z';e>'a';e--)
{
if(e>='e')
printf("%c%c%c%c%c\n",a,b,c,d,e);
if(e=='d')
break;
}
}
}
printf("\n%c%c%c%c%c\nFound It!\n\n",a,b,c,d,e);
printf("Press Enter");
getchar();
}Thanks for y'alls help David |
|
|
|
|
|
#15 |
|
Newbie
Join Date: Mar 2005
Posts: 18
Rep Power: 0
![]() |
Another thing you could allways do if you didnt want to edit the code, is run the command prompt (assuming you are using windows) and run the exe through that (drag and drop works too). That way it should stay open and you wont have an extra line in your code.
|
|
|
|
|
|
#16 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Before getchar();, bung this line in:
fflush(stdin); |
|
|
|
|
|
#17 |
|
Programming Guru
![]() ![]() ![]() |
#include <stdlib.h>
... ... ... system("PAUSE"); ... ... ...
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#18 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
According to the great Eggo, that's a bad idea, because people can screw around with the "pause" command to bugger up your app.
|
|
|
|
|
|
#19 |
|
Hobbyist Programmer
Join Date: Nov 2004
Location: 1691 miles East of L.A.
Posts: 159
Rep Power: 4
![]() |
I code in Notepad then use gcc to compile and run from the command prompt.
__________________
-- lostcauz Stepped in what?... Behind whose barn?... I didn't even know they had a cow! |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|