• Lucid Dreaming - Dream Views




    Results 1 to 25 of 102
    Like Tree3Likes

    Thread: Ask me about C / C++

    Hybrid View

    1. #1
      Same great taste! Achievements:
      1 year registered 1000 Hall Points Veteran First Class
      Flavour of Night's Avatar
      Join Date
      Jan 2006
      LD Count
      Thousands.
      Gender
      Location
      East Tennessee
      Posts
      308
      Likes
      0
      Quote Originally Posted by ninja9578 View Post
      Yep, C code runs circles around VB code.
      Damned straight. Once compiled, does VB still toss in enormous wodges of non-essential crap from over-stuffed libraries?

    2. #2
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Not really, it's fairly compressed. There is some overhead, for instance, strings have about 4 levels of abstraction around then so every string manipulation requires about 4 times the work as in C++. VB is designed to be a learning tool, not a professional programming app, so the compiler is not very efficient at optimizing.

    3. #3
      Member Keresztanya's Avatar
      Join Date
      Mar 2008
      Gender
      Posts
      1,083
      Likes
      32
      What is the best book on C to read?

    4. #4
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      "The C Programming Language"

    5. #5
      Same great taste! Achievements:
      1 year registered 1000 Hall Points Veteran First Class
      Flavour of Night's Avatar
      Join Date
      Jan 2006
      LD Count
      Thousands.
      Gender
      Location
      East Tennessee
      Posts
      308
      Likes
      0
      Quote Originally Posted by ninja9578 View Post
      Not really, it's fairly compressed. There is some overhead, for instance, strings have about 4 levels of abstraction around then so every string manipulation requires about 4 times the work as in C++. VB is designed to be a learning tool, not a professional programming app, so the compiler is not very efficient at optimizing.
      I can still remember compiling "Hello World" for lulz in the old QB 4.5.. 14 Kb for: print "Hello World!"

      C compiled it much tighter only needing the include for stdio.h for the printf.

      Doing it in my old Borland Assembler only took a handful of bytes once compiled and linked to knock out a .com file with a label of:

      mssg db 'Hello World!",13,10,'$'

      then nothing more than:

      lea dx, mssg
      mov ah, 4ch
      Int 21


      Those DOS calls sure are handy. You could do it also with Int 9, but that's a bit more work.

      After awhile, you'd start to recognize the actual machine code for some of the calls and the like.

      Seems silly now, but, I can lay claim to having once owned a 10 meg HD, so the "who cares" attitude of today was a luxury unaffordable back then.

      code is fun, I've not bothered with it in years.. kinda makes me want to get my fingers back in shape.

      .

    6. #6
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Good for you. I grew up with some less than optimal machines and I got really good at doing optimizations, I still do it. Qbasic was fun

      Code:
      ? "QBasic is awesome!"

    7. #7
      khh
      khh is offline
      Remember Achievements:
      1000 Hall Points Veteran First Class
      khh's Avatar
      Join Date
      Jun 2009
      Gender
      Location
      Norway
      Posts
      2,482
      Likes
      1309
      How do you find the execution time and memory imprint of your code?
      (I'm using windows, btw)
      April Ryan is my friend,
      Every sorrow she can mend.
      When i visit her dark realm,
      Does it simply overwhelm.

    8. #8
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Your memory imprint should be visible in your Task Manager (ctrl+alt+del)

      As for execution time, all you need to do it have your program record the time when it starts, then record it again when it quits. Subtract the two and print the result

    9. #9
      I am God Kastro187420's Avatar
      Join Date
      Mar 2005
      Gender
      Location
      Here is everywhere you are
      Posts
      481
      Likes
      13
      I've always been interested in learning C/C++, but could never find any good reference/learning sources.

      Having an understanding of php and some sql (basic sql functions such as update/insert/delete/drop, enough to maintain a database), aswell as basic Javascript, how hard do you figure it would be to move into the C languages?

    Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •