LINUX LITE 7.2 FINAL RELEASED - SEE RELEASE ANNOUNCEMENTS SECTION FOR DETAILS


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C Programming in Linux
#6
(04-19-2015, 12:05 PM)hhbuur link Wrote: i get the same outputs as before no mater witch of yours variations I try, can there may be a differences in the versions of gcc, makes the difference in the output, the version i haw install is 4:4.8.2-1ubuntu6 , and your ? I get the same result as in the book

I used 32-bit LL 2.2 and the gcc package is the same version# as yours.


I just downloaded the book so I could see exactly what the exercise was.  Aside from making the correction from "DEFINE" to "define", it all looks the same as what I input and the output from mine matches that of the book (with no error messages).  In all likelihood, if you're still getting error messages, you have a typo somewhere or a missed character.  Double-check what you have.

From what you've posted, the only other thing I noticed is that you had a space between "sizeof" and "(int)" on this line:
Code:
    printf("memory used:%d bytes\n",
        ((STRINGSIZE*3) * sizeof(char)) + sizeof (int) + (2 * sizeof(float)));

However, I purposely ran the code with that space also and it did not give me an error -- so I doubt that is the source of your problem.

Only other thing that  I can think of is that you made the change from "DEFINE" to "define", saved the document, but did not re-compile the program with the new change.  You need to save the change in the text file, then re-compile it before running the program again.

Aside from that, I'm clueless as to why it's not working for you.
Try Linux Beginner Search Engine for answers to Linux questions.
Reply


Messages In This Thread
C Programming in Linux - by hhbuur - 04-14-2015, 11:16 AM
Re: C Programming in Linux - by gold_finger - 04-18-2015, 02:46 AM
Re: C Programming in Linux - by hhbuur - 04-18-2015, 10:29 AM
Re: C Programming in Linux - by gold_finger - 04-18-2015, 01:55 PM
Re: C Programming in Linux - by hhbuur - 04-19-2015, 12:05 PM
Re: C Programming in Linux - by gold_finger - 04-19-2015, 02:24 PM
Re: C Programming in Linux - by avj - 04-19-2015, 04:54 PM
Re: C Programming in Linux - by hhbuur - 04-21-2015, 09:27 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)