hi frnz,
i want to create an exe (using c) which first, gets users' choice and then runs in background. i am using TCC compiler. and my os is xp.
can anyone pls suggest a solution?
hi frnz,
i want to create an exe (using c) which first, gets users' choice and then runs in background. i am using TCC compiler. and my os is xp.
can anyone pls suggest a solution?
You can hide the console window with "ShowWindow(GetConsoleWindow(), SW_HIDE)" but that's only for Windows.
EDIT: By the way, where is KERALA???
Devoted my life to programming...
Well it's tough to write a program in an emulated environment which can actually do anything significant to the host.
Stop mucking about with TurbidCrap on XP.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Actually Salem... TCC probably refers to the TinyC compiler...
Use a If condition before the main body of the program and then make it true according to user's Choice..
Try posting some of the code you're working with, so we can see what it is you're trying to do.
One-line posts vaguely describing the problem are not going to cut it.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
@ salem
since it requires a long time for the flag to become 1, i want to put the program in background. This is the problem i hav!Code:#include<stdio.h> #include<conio.h> #include<time.h> void main() { int hr,min,flag=0; struct time t; printf("Enter the time: "); printf("\n\tHours: "); scanf("%d",&hr); printf("\n\tMinutes: "); scanf("%d",&min); do { gettime(&t); if(t.ti_hr==hr&&t.ti_min==min) flag=1; }while(flag); system("c:\\windows\\system32\\shutdown -s"); }
So I take it from the conio.h and void main that you are in fact using the 20+ year old FOSSIL compiler Turbo C Compiler (TCC) and not the modern TinyCCompiler that CommonTater linked to.
Just because you managed to get "hello world" to work with it does NOT make it suitable for every other programming task you might have.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
You'd have to ask Adak, he's the only TC fan still left on this forum.
Most other people no longer care about answering TC questions, even if they know the answer.
Try getting a modern compiler for your real OS and try the same code again (with int main, and NO conio.h).
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
If you are using Borland's Turbo C compiler a lot of stuff is --or soon will be-- impossible...
Turbo C is a 16 bit compiler, made for pre-iapx386 computers. Most computers are now 32/64 bit compatible and the slow migration to 64 bit OSs is underway. 64 bit Windows OSs do not support 16 bit programs anymore. If you are not working with at least a 32 bit compiler you will soon find yourself writing code that only works on old computers. And with 128bit machines already in the planning stages it won't be long until 32 bit systems suffer a similar fate.
For your problem of making your timer run in the background... just click the "minimize" icon on the upper right corner of the command shell... It will be minimized to the task bar where it's out of the way.