Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!linac!att!cbnewsl!cbnewsk!linwood From: linwood@cbnewsk.att.com (linwood.d.johnson) Newsgroups: comp.lang.c Subject: Re: Help: VAX C problem Message-ID: <1991Mar30.161854.27378@cbnewsk.att.com> Date: 30 Mar 91 16:18:54 GMT References: <11697.27f376d8@zeus.unomaha.edu> Organization: AT&T Bell Laboratories Lines: 45 In article <11697.27f376d8@zeus.unomaha.edu> kkrueger@zeus.unomaha.edu (Kurt Krueger) writes: >I wrote and compiled my program on my Amiga, and it runs fine; >however, I can't get it to run on our VAX. I know next to nothing about C >programming on the VAX (the truth is, I know little about C, as well), and I >would be happy if someone could point out my folly. The program is as follows: > >extern int atoi(); >float size, time; >int block, mins, secs; > >main (argc, argv) > >int argc; >char *argv[]; > >{ > int result, value(); > printf ("%s", argv[1]); > block = value(argv[2]); > size = block / 2; > time = size / 0.2227; > mins = time / 60; > secs = time - (mins * 60); > printf ("\t\t%d\t%d\n", mins, secs); >} > >int value(number1) >char *number1; >{ > int convblock = atoi(number1); ****** Wouldn't you want this function to return something since you are using the return value. I think something like: return( convblock); will do the trick. >} -- | Linwood D. Johnson | linwood@ihlpf.att.com | | AT&T Bell Labs, 1000 E. Warrenville Rd., Naperville, IL 60566 | | Disclaimer: Opinions expressed here are mine and mine only. | | Besides, who else would want them? |