Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!gatech!udel!mmdf From: LIZAK98%SNYBUFVA.BITNET@cornellc.cit.cornell.edu (A SHOW OF HANDS) Newsgroups: comp.sys.amiga Subject: Struggling through the "C" Message-ID: <12000@louie.udel.EDU> Date: 31 Mar 89 19:55:49 GMT Sender: mmdf@udel.EDU Lines: 45 This one is probably old hat for any of you C programmers out there, but I am having a hell of a time writing this little routine. Awhile back I wrote a BBS program that is a C-Net look alike, however, because the only language that I knew that I had on my Amiga was BASIC, I had to use that. The thing runs toooo slow for any real application other than saying, oh it looks nice... too bad it doesnt keep up with 2400 baud... Anyways, the output routine was written something like this (it's more complex as it checks for control characters, etc before printing, but this is the major part): FOR I=1 TO LEN(A$) PRINT MID$(A$,I,1); NEXT I I posted this to a BBS and asked for a C equivlent, however, what I got was a fragment of what I really needed... here is what was posted for me... for(i=0;a[i]=!'\0';i++) printf("%c",a[i]); no matter what I put for the declaration... it wouldnt work! I added this to the program to try to make it work... whats wrong with this? main() { char *a; int i; a="This is a test string..."; ...above code.... } How must I declare a? How must I define the string? Thanks, ##################################################################### # # # Rob Lizak Jr. Bitnet ID: LIZAK98@SNYBUFVA # # DECNet ID: BSCOLA::LIZAK98 # # # # "Once YOU buy a prize, it's YOURS to keep!" # # # #####################################################################