|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
C: determining no. of args in argv
how do you determine the no. of arguments in the argv array?
i've been trying to figure out how to determine the size of an array and that was easily possible in PHP and Perl... i've used them for so long and forgotten about how it works in C!... i do recall that there isn't a quick and easy way to determine an array size in C i think... |
|
#2
|
||||
|
||||
|
vid main(int argc, char *argv[])
__________________
And you know I mean that. |
|
#3
|
||||
|
||||
|
thanks
... i was walking around and it also suddenly struck me that that's what the argc parameter was for!...as for the size of an array, would something like sizeof(array)/sizeof(element) work you think? |
|
#4
|
|||
|
|||
|
I've always used sizeof(array)/sizeof(array[0]).
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > C: determining no. of args in argv |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|