TranceAddict Forums (www.tranceaddict.com/forums)
- Chill Out Room
-- C programming inquiry
C programming inquiry
this goes out to all with C experience. kinda pulling my hair over this program. have a question for all of u?
lets say I have "if ( ) else ( )"
can I have a while loop in the "if" and a do-while loop in the else part of my program. ???
thanx. is it valid??
kinda of a beginner??
u dont need the if else just use couple of loops cause if the condition fails in the first one it will go to the seconf one..that is if u got ur question right ot u van include if within the while
first off the structure is:
if (
{}
else
{};
so you have a block of code for your condition and one for any other case. The else block is like any other block of code. So basically: yes, you can. 
Just curious, what is your assignment?
thanX
c is a pain. kinda have to get used to it. It helps when I print out my script file and got through the steps in my head.
well guys....I might have to call upon u again so don't go nowhere

Re: C programming inquiry
| quote: |
| Originally posted by digitalbreach this goes out to all with C experience. kinda pulling my hair over this program. have a question for all of u? lets say I have "if ( ) else ( )" can I have a while loop in the "if" and a do-while loop in the else part of my program. ??? thanx. is it valid?? kinda of a beginner?? |
code:
do { some code... if(a >1) { while(c<3) { printf(c); c = c + 1; } } else { printf("hello world/n"); } a++ }while(a < 4);
just cuz i forgot
if I finished my "blah.c" file and i also have an input file "blah.dat"(bare w/ me)
how do I test it in Unix system
using the unix compiler cc
thanx
For your reference check out this book C Programming Language Second Edition
It's considered as the C bible 
| quote: |
| Originally posted by digitalbreach just cuz i forgot if I finished my "blah.c" file and i also have an input file "blah.dat"(bare w/ me) how do I test it in Unix system using the unix compiler cc thanx |
well I loaded my "blah.dat" file (contains the input needed for program to execute)
also loaded "blah.c" file into Unix using the ftp and put command
next I telnet into unix. I ftp'd it as and anscii file type. supposed to.
so I try to compile my "blah.c" file using cc and given parameters but it gives me errors.
prints out gibberish(guessing it supposed to do that) than it says:"
ld:
Unresolved:
acos
fabs
pow
sqrt
assuming it can't process those commands which are inside my "blah.c" file. probably need to input some sort of math directory??? helppppp??????
| quote: |
| Originally posted by digitalbreach than it says:" ld: Unresolved: acos fabs pow sqrt assuming it can't process those commands which are inside my "blah.c" file. probably need to input some sort of math directory??? helppppp?????? |
had already done that, in the beginning of my program.
any other suggestions. oh..fyi: fabs (absolute value for floats)
| quote: |
| Originally posted by daydreamer had already done that, in the beginning of my program. any other suggestions. oh..fyi: fabs (absolute value for floats) |
haha... i was just typing up the command incorrectly....the whole fucking time!!!
well thanx for all ya's help. thanx dritz
works like a charm now!!! woot

ok here's a question:
why does digitalbreach ask a question.
I answer and then daydreamer tell me that he had already done that as if he had written the same program as digitalbreach???
whatever do u mean???
Now that's a riddle within itself
well my good lad...
i was replying to your post and my gay brother forgot to log out. so I posted under his profile. thanx again.
whatever do u mean???
Now that's a riddle within itself
well my good lad...
i was replying to your post and my gay brother forgot to log out. so I posted under his profile. thanx again.
question what is your favorite compiler to use???
using Visual C++ so far...its ok
Powered by: vBulletin
Copyright © 2000-2021, Jelsoft Enterprises Ltd.