Thread: C Programming Tips for Advanced Programming

  1. #1
    Registered User
    Join Date
    Feb 2019
    Posts
    3

    C Programming Tips for Advanced Programming

    I have shared Programming Tips for Platform Independent (Portable) programming in this Forum. While working on a project in USA in 1991-92, I also noted down some interesting points of C programming as I learned. I am sharing these points here in the attached PDF. As File size increases, I am sharing points in 3 parts (3 PDFs attached)

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > X * Y + 1 means X * (Y + 1)
    No it doesn't.

    Code:
    In char *name[] = {“a”, “bcd”, “efghijk”};
    > 1 st element “a” occupies one byte.
    No, it occupies two bytes.
    Each of your strings has a \0 at the end.

    > Thus two dimensional array occupies unnecessary space.
    But you didn't count for all the pointers in your char *name case.
    Which actually takes up more space in any given situation depends on how similar all the string lengths are.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 0
    Last Post: 02-01-2019, 12:27 PM
  2. Replies: 0
    Last Post: 02-01-2019, 12:22 PM
  3. Programming Tips
    By webmaster in forum General Discussions
    Replies: 27
    Last Post: 10-29-2018, 12:49 PM
  4. C++ Programming Tips
    By gflores in forum C++ Programming
    Replies: 20
    Last Post: 09-14-2004, 07:53 PM
  5. MUD Programming Tips
    By tyler in forum Game Programming
    Replies: 1
    Last Post: 04-15-2002, 09:17 AM

Tags for this Thread