Become a part of the TranceAddict community!Frequently Asked Questions - Please read this if you haven'tSearch the forums
TranceAddict Forums > Main Forums > Chill Out Room > C programming inquiry
Pages (2): [1] 2 »   Last Thread   Next Thread
Share
Author
Thread    Post A Reply
digitalbreach
the sky is falling



Registered: Oct 2002
Location: TX TA #3 5p4c3 C!ty
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??


___________________

You ain't no daisy, no daisy at all

Old Post Jan-30-2003 06:42  United States
Click Here to See the Profile for digitalbreach Click here to Send digitalbreach a Private Message Add digitalbreach to your buddy list Report this Post Reply w/Quote Edit/Delete Message
tranceaholic
chus & Ceballos addict



Registered: Mar 2002
Location: behind the decks

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

Old Post Jan-30-2003 07:24  Egypt
Click Here to See the Profile for tranceaholic Click here to Send tranceaholic a Private Message Add tranceaholic to your buddy list Report this Post Reply w/Quote Edit/Delete Message
halo
...



Registered: Jul 2002
Location: GTA #303 ;P

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.


___________________

DISCLAIMER:
The above text is believed to be derived from objective logic. No personal offence, implicit or explicit, is intended. Ambiguous expressions are to be interpreted in the less offensive way.

Old Post Jan-30-2003 16:40  Germany
Click Here to See the Profile for halo Click here to Send halo a Private Message Add halo to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Kirby
Supreme tranceaddict



Registered: Mar 2002
Location: Middletown, CT or Durham, NH

Just curious, what is your assignment?

Old Post Jan-31-2003 01:23  United States
Click Here to See the Profile for Kirby Click here to Send Kirby a Private Message Add Kirby to your buddy list Report this Post Reply w/Quote Edit/Delete Message
digitalbreach
the sky is falling



Registered: Oct 2002
Location: TX TA #3 5p4c3 C!ty
Hello!

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



___________________

You ain't no daisy, no daisy at all

Old Post Jan-31-2003 05:22  United States
Click Here to See the Profile for digitalbreach Click here to Send digitalbreach a Private Message Add digitalbreach to your buddy list Report this Post Reply w/Quote Edit/Delete Message
drizzt81
Professional Lamer



Registered: Nov 2001
Location: GTA #1 - At work
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??


yes u can:

code:
do { some code... if(a >1) { while(c<3) { printf(c); c = c + 1; } } else { printf("hello world/n"); } a++ }while(a < 4);


___________________

get font

I see your 4 Crushs and raise you 3 As The Rush Comes. - Yan from PvD's first summerstage event in '03

Old Post Jan-31-2003 08:15  Germany
Click Here to See the Profile for drizzt81 Click here to Send drizzt81 a Private Message Add drizzt81 to your buddy list Report this Post Reply w/Quote Edit/Delete Message
digitalbreach
the sky is falling



Registered: Oct 2002
Location: TX TA #3 5p4c3 C!ty
Hello!

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


___________________

You ain't no daisy, no daisy at all

Old Post Feb-01-2003 01:39  United States
Click Here to See the Profile for digitalbreach Click here to Send digitalbreach a Private Message Add digitalbreach to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Stanza
Natural Born Trancer



Registered: Oct 2001
Location: Sydney

For your reference check out this book C Programming Language Second Edition

It's considered as the C bible

Old Post Feb-01-2003 02:29  Australia
Click Here to See the Profile for Stanza Click here to Send Stanza a Private Message Add Stanza to your buddy list Report this Post Reply w/Quote Edit/Delete Message
drizzt81
Professional Lamer



Registered: Nov 2001
Location: GTA #1 - At work

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

assumig: the .dat file is read within your program

put both in a nice dir

then look http://helpme.scudc.scu.edu/compilers.html <

u want to pay attention to this line:

cc prog1.c -o prog1


___________________

get font

I see your 4 Crushs and raise you 3 As The Rush Comes. - Yan from PvD's first summerstage event in '03

Old Post Feb-01-2003 02:43  Germany
Click Here to See the Profile for drizzt81 Click here to Send drizzt81 a Private Message Add drizzt81 to your buddy list Report this Post Reply w/Quote Edit/Delete Message
digitalbreach
the sky is falling



Registered: Oct 2002
Location: TX TA #3 5p4c3 C!ty
Question

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??????


___________________

You ain't no daisy, no daisy at all

Old Post Feb-01-2003 22:58  United States
Click Here to See the Profile for digitalbreach Click here to Send digitalbreach a Private Message Add digitalbreach to your buddy list Report this Post Reply w/Quote Edit/Delete Message
drizzt81
Professional Lamer



Registered: Nov 2001
Location: GTA #1 - At work

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??????


try adding

#include to the top of your source code, then ftp and compile again.. see what happens. That _should_ take care of swrt, pow, acos.. i do not know what fabs does though


___________________

get font

I see your 4 Crushs and raise you 3 As The Rush Comes. - Yan from PvD's first summerstage event in '03

Old Post Feb-02-2003 09:18  Germany
Click Here to See the Profile for drizzt81 Click here to Send drizzt81 a Private Message Add drizzt81 to your buddy list Report this Post Reply w/Quote Edit/Delete Message
daydreamer
disco baby



Registered: Apr 2002
Location: TX TA #1

had already done that, in the beginning of my program.
any other suggestions. oh..fyi: fabs (absolute value for floats)

Old Post Feb-03-2003 04:11  Spain
Click Here to See the Profile for daydreamer Click here to Send daydreamer a Private Message Add daydreamer to your buddy list Report this Post Reply w/Quote Edit/Delete Message

TranceAddict Forums > Main Forums > Chill Out Room > C programming inquiry
Post New Thread    Post A Reply

Pages (2): [1] 2 »  
Last Thread   Next Thread
Click here to listen to the sample!Pause playbackTracking this track :) [2007] [0]

Click here to listen to the sample!Pause playbackBreeze - Ready for Love (Vocal Trance Mix) [2004]

Show Printable Version | Subscribe to this Thread
Forum Jump:

All times are GMT. The time now is 20:35.

Forum Rules:
You may not post new threads
You may not post replies
You may not edit your posts
HTML code is ON
vB code is ON
[IMG] code is ON
 
Search this Thread:

 
Contact Us - return to tranceaddict

Powered by: Trance Music & vBulletin Forums
Copyright ©2000-2026, Jelsoft Enterprises Ltd.
Privacy Statement / DMCA
Support TA!