TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ERIK WARMELINK
from: DAVID TORREZ
date: 1997-05-06 17:47:00
subject: Pointer Arrays

-> JB> void battle(int id[])
-> JB> { int num = sizeof(id) /
-> sizeof(int);  // A variable number of objects get passed
-> I am afraid this doesn't do what you want. sizeof(id) is not the size
-> of the array you passed, it is the size of an int pointer.
sizeof() returns the size of the type.
sizeof(int) will return a 2 when using a 16-bit compiler, and 4 when
using a 32-bit compiler.
                Dave - zanti@pacbell.net
--- QScan/PCB v1.19b / 01-0218
---------------
* Origin: The Target Range II 310/634-8993 (1:102/420)

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™.