Hi Victor. Thanks for your help.
Regards
Paulo
--- In [EMAIL PROTECTED], "Victor A. Wagner Jr." <[EMAIL PROTECTED]>
wrote:
> you don't have any useful information about the size of a in f()
>
> At Friday 2004-11-05 13:31, you wrote:
>
>
> >Hi all
> >
> >I'm a newbie in C/C++ and I have a trouble in the following code.
> >
> >#include <iostream>
> >using namespace std;
> >
> >void f(char *a[])
> >{
> > int i = sizeof(a) / sizeof(a[0]);
> > cout << "sizeof(a) / sizeof(a[0]) = " << i << endl;
> >}
> >
> >int main(int argc, char **argv)
> >{
> > char *v[] = {"jan", "fev", "mar"};
> > f(v);
> >
> > int i = sizeof(v) / sizeof(v[0]);
> > cout << "sizeof(v) / sizeof(v[0]) = " << i << endl;
> >}
> >
> >When this program is executed the output is:
> >
> >sizeof(a) / sizeof(a[0]) = 1
> >
> >sizeof(v) / sizeof(v[0]) = 3
> >
> >Why? Any help will be welcome
> >
> >Thanks in advance
> >Paulo
> >
> >
> >
> >
> >
> >
> >To unsubscribe, send a blank message to
> ><mailto:[EMAIL PROTECTED]>.
> >Yahoo! Groups Links
> >
> >
> >
> >
>
> Victor A. Wagner Jr. http://rudbek.com
> The five most dangerous words in the English language:
> "There oughta be a law"
To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.
| Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/c-prog/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
