Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Array Index

This is a discussion on Array Index within the C and C++ forums, part of the Software Development category; array size int a[4] why it starts from 0 only why we cant have 1 int a[1]=4, instead of zero can someone clarify it...

Go Back   Geeks Talk > Software Development > C and C++
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 01-24-2009
Junior Member
 
Join Date: May 2008
Location: india
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
arunmws is on a distinguished road
Array Index

array size int a[4]

why it starts from 0 only why we cant have 1
int a[1]=4,
instead of zero
can someone clarify it
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-28-2009
Junior Member
 
Join Date: Jan 2009
Posts: 6
Thanks: 1
Thanked 1 Time in 1 Post
ganesh bala is on a distinguished road
Re: Array Index

"Arrayname gives starting location where data was stored...."

ex.. int a[10];

a -> starting location
which is nothing but a[0] => *(a+0)

a+1 --> next location

which is nothing but a[1] => *(a+1)


So, index should starts with zero......

So that we can use from memory alloted for our array
Reply With Quote
Reply

  Geeks Talk > Software Development > C and C++

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
B-tree index and Bitmap index Lokesh M Data Warehousing 1 12-14-2008 06:01 AM
clustered index and nonclustered index it_uday Oracle 5 08-19-2008 02:18 AM
convert one dimansional array to two dimansional array Geek_Guest C and C++ 6 12-22-2007 04:17 AM
static array or dynamic array? rpgubba C and C++ 6 12-22-2007 04:03 AM
index rakhi1275 Data Warehousing 1 05-11-2007 06:54 AM


All times are GMT -4. The time now is 03:32 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved