TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALEX WALKER
from: CAMERON CLARK
date: 1997-12-09 13:51:00
subject: Re: Finding the end of an array?

AW>      Just wondering, if an array is passed to a function, is there a way 
AW>      to test for or find the end of the array without having the size of
AW>      the array passed to the function?
    Remeber that an array name itself is just a pointer to the very
    first item.
    Why no end exsists, can be tested for:
    char c[20];
    c[21] = 'a';
    There is no bounds checking for c/c++ arrays. Unless you create
    you're own array class, then you have to pass the size to the
    function.
--- GEcho 1.00
---------------
* Origin: Digital OnLine Magazine! - (409)838-8237 (1:3811/350)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.