Indexing 1

This is a discussion on Indexing 1 within the C Programming forums, part of the General Programming Boards category; What does "all indexing is based on 1" i know that C automatically does everything based on 0, how do ...

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    15

    Indexing 1

    What does "all indexing is based on 1"

    i know that C automatically does everything based on 0, how do i get it to 1?


    do i just go


    /code

    for(i=0; i<(s->len); i++)

    does this make some sense?

  2. #2
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,812
    You want to start at 1 just make i = 1. But the reason you ussually see this is because
    1) Arrays start at 0 not at 1.
    2) That is a kinda of a standard for, for loops structure.
    Woop?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. indexing overload concept idea
    By Trauts in forum C++ Programming
    Replies: 6
    Last Post: 05-18-2003, 11:00 PM
  2. about inverted indexing program
    By Abdi in forum C++ Programming
    Replies: 1
    Last Post: 04-25-2003, 09:50 AM
  3. resources for network media indexing application
    By goose in forum Windows Programming
    Replies: 2
    Last Post: 10-14-2002, 03:04 AM
  4. Replies: 4
    Last Post: 10-11-2002, 07:58 AM
  5. Array Indexing w/ strlen()
    By c++_n00b in forum C++ Programming
    Replies: 8
    Last Post: 06-04-2002, 12:18 PM

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