Static arrays and ellipsis

This is a discussion on Static arrays and ellipsis within the C Programming forums, part of the General Programming Boards category; Originally Posted by tabstop Ellipses have been in C since well before 1999 and templates have been in C since ...

  1. #16
    Banned
    Join Date
    May 2009
    Posts
    37
    Quote Originally Posted by tabstop View Post
    Ellipses have been in C since well before 1999 and templates have been in C since exactly never.

    And they did it for you anyway:
    Code:
    type array[SIZE] = {[SIZE-4]=1, 2, 3, 4};
    (EDIT: Oh, if you mean ellipses for macros, then I think that is new in 99 yes. I still have no idea where you're headed with templates, though.)
    ohh.. crap.. the code above works.... i didn't know you could do that.

  2. #17
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by renzokuken01 View Post
    EXACTLY!!! omfg you, mean, you didn't see this coming?? alright, i'll lay down to you simply so you understand me in detail.
    Your point is that you want to do it backwards. You said "what do you think of intitializing the start", I said that the feature already exists.

    I still stand by my previous statement: It's impossible for me to dream up a scenario where I only want to initialize the tail end of an array. As a matter of fact, the only reason I ever want to only initialize the start of an array, is when I want it to be a string. Other than that, I have no use for partially initialized variables.
    Quote Originally Posted by renzokuken01 View Post
    well from my example above, you can clearly see that i traverse the arrays from highest place to the lowest... and the reason for that may be a variety of things... for my case it's because how CPU flag registers work in CISC... so it's very easy to see why it can be VERY advantageous to address the last elements.... in that manner, initializing the start of a static array is absolutely no different from initializing the last ones.
    Premature optimization, IMO.


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

  3. #18
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by renzokuken01 View Post
    i swear to god... if anybody uses this code for any of their projects, i will hunt you down.

    and don't even think of publishing as everybody knows whose work this is
    WOW... totally classic melt down!

    My friend, you need more help than you're ever going to get here.

  4. #19
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Quote Originally Posted by CommonTater View Post
    WOW... totally classic melt down!

    My friend, you need more help than you're ever going to get here.
    How can you say that?

    (I know, with your vocal cords, but let's not digress)

    Lucy is in the house, and her sign says:

    Code:
    ******************************************
    *          The Psychiatrist              *
    *                                        *
    *                is IN                   *
    *                                        *
    ******************************************
    Linus is currently yakking with her, but his hour is up in just a few minutes.

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

Tags for this Thread


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