| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Pointer Arrays |
Joshua, you wrote to All:
JB> Here is the code fragment:
JB> void battle(int id[])
JB> {
JB> int num = sizeof(id) / sizeof(int); // A variable number of
JB> // 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.
Bye,
Erik
---
---------------
* Origin: WarmelinkE@vertis.nl (2:282/608.60) |
|
| 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™.