Like Tree5Likes

[General Help] Dynamic Arrays and General Pointer syntax

This is a discussion on [General Help] Dynamic Arrays and General Pointer syntax within the C Programming forums, part of the General Programming Boards category; Originally Posted by grumpy It's a bit hard to be specific with a small snippet of code like that (a ...

  1. #16
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by grumpy View Post
    It's a bit hard to be specific with a small snippet of code like that (a lot of the logic of creating self-documenting code is easier if you know the purpose of the code from a perspective of a caller, for example). If forced to choose though, I'd prefer commented code over an unintelligible mess, certainly.
    Well... FWIW, it's sorting out the unicode format of a playlist file and converting it to windows WCHAR format (through called functions).

  2. #17
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    You are all doing it wrong! C99 gives your functions 63 characters for names, so you should use them to the fullest!
    Code:
    void MakeALinkedListofStudentInformation( struct ThisIsAllTheInformationForOneStudent ** thisIsTheListOfStudents )
    {
        struct ThisIsAllTheInformationForOneStudent * thisWillHoldOurStudentListForTheTimeBeing;
        thisWillHoldOurStudentListForTheTimeBeing = AllocateMemoryForASingleStudentStructure();
        ...
    }
    See, no comments needed!


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #18
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,661
    We all have big widescreens now; might as well use them.
    quzah likes this.

  4. #19
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by quzah View Post
    You are all doing it wrong! C99 gives your functions 63 characters for names, so you should use them to the fullest!
    Code:
    void MakeALinkedListofStudentInformation( struct ThisIsAllTheInformationForOneStudent ** thisIsTheListOfStudents )
    {
        struct ThisIsAllTheInformationForOneStudent * thisWillHoldOurStudentListForTheTimeBeing;
        thisWillHoldOurStudentListForTheTimeBeing = AllocateMemoryForASingleStudentStructure();
        ...
    
    HandleErrorCausedByStupidSpellingMistake403LinesAgo();
    
    }
    See, no comments needed!


    Quzah.
    Reply in quote....

    (See, a comment was needed )

  5. #20
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by CommonTater View Post
    (See, a comment was needed )
    That's what compiler warnings are for. :P
    Quote Originally Posted by whiteflags View Post
    We all have big widescreens now; might as well use them.
    I liked the old Mac monitors that were full height. Something like this: http://www.youtube.com/watch?v=YvqxvODBydo (Ignore the dude talking, he doesn't sound like he knows anything about old Macs.)


    Quzah.
    Last edited by quzah; 07-26-2011 at 03:30 PM.
    Hope is the first step on the road to disappointment.

  6. #21
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by quzah View Post
    That's what compiler warnings are for. :PI liked the old Mac monitors that were full height. Something like this: ‪Apple Macintosh IIsi with Radius Full Page Display Monitor‬‏ - YouTube (Ignore the dude talking, he doesn't sound like he knows anything about old Macs.)
    Quzah.
    The guy nailed it... they were literally a 14" picture tube turned on it's side. The HV connection was on the left and the electronics were on the right...

  7. #22
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by CommonTater View Post
    The guy nailed it... they were literally a 14" picture tube turned on it's side. The HV connection was on the left and the electronics were on the right...
    They were sweet! (But I started ignoring him once he was amazed by the floppies after admitting to know nothing of old Macs, so I didn't listen to his description of the monitor.) I was just looking for a picture of one for illustration purposes.


    Quzah.
    Hope is the first step on the road to disappointment.

  8. #23
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by quzah View Post
    They were sweet! (But I started ignoring him once he was amazed by the floppies after admitting to know nothing of old Macs, so I didn't listen to his description of the monitor.) I was just looking for a picture of one for illustration purposes.
    Quzah.
    Need a picture of an old computer? Welcome to OLD-COMPUTERS.COM ! Most often they also have the specs and even pictures of the innards...
    quzah likes this.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginner question about understanding general Syntax
    By lucidrave in forum C++ Programming
    Replies: 15
    Last Post: 08-13-2009, 03:57 PM
  2. arrays vs lists? And containers in general!
    By clegs in forum C++ Programming
    Replies: 22
    Last Post: 12-03-2007, 01:02 PM
  3. Pointer Passing Problems/ General Confusion
    By Swordsman in forum C Programming
    Replies: 11
    Last Post: 05-06-2007, 08:56 AM
  4. C in general
    By majoub in forum C Programming
    Replies: 3
    Last Post: 02-17-2005, 01:06 PM
  5. general pointer & malloc question
    By jstn in forum C Programming
    Replies: 2
    Last Post: 05-14-2002, 09:51 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21