Re: Getting array size
From: Phil Frisbie, Jr. (phil_at_hawksoft.com)
Date: 12/07/04
- Next message: Igor Tandetnik: "Re: Getting array size"
- Previous message: Gnum: "Re: OpenGL question"
- In reply to: Mark: "Getting array size"
- Next in thread: Mark: "Re: Getting array size"
- Reply: Mark: "Re: Getting array size"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 07 Dec 2004 14:58:48 -0800
Mark wrote:
> I'm writing a program that takes start up parameters, but when I try to get
> the size of the array, it always returns 4.
>
> int _tmain(int argc, _TCHAR* argv[])
> sizeof(argv) is always 4 no matter what.
You need more basic C lessons....
sizeof() is evaluated at compile time, and argv is a POINTER, which on win32 is
always 4 bytes (32 bits). argc already tells you how many entries are in argv,
so tell us what you are attempting to do.
> Thanks
> Mark
-- Phil Frisbie, Jr. Hawk Software http://www.hawksoft.com
- Next message: Igor Tandetnik: "Re: Getting array size"
- Previous message: Gnum: "Re: OpenGL question"
- In reply to: Mark: "Getting array size"
- Next in thread: Mark: "Re: Getting array size"
- Reply: Mark: "Re: Getting array size"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|