From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: "André Albergaria Coelho" <andre1coelho@outlook.com>
Cc: gcc@gcc.gnu.org
Subject: Re: function parameters
Date: Tue, 21 Nov 2023 11:42:37 +0000 [thread overview]
Message-ID: <CAH6eHdT1mSaiKFRepFMM+ZiAa=Sj+qdjHvRjaM+-vaXsZfGCow@mail.gmail.com> (raw)
In-Reply-To: <PR3P250MB0372D1C6EC3B11289DBBC13993BBA@PR3P250MB0372.EURP250.PROD.OUTLOOK.COM>
On Tue, 21 Nov 2023 at 02:31, André Albergaria Coelho via Gcc
<gcc@gcc.gnu.org> wrote:
>
> Hello
Hello,
This mailing list is for discussing the development of GCC itself, not
for help with basic C programming. Please use the gcc-help@gcc.gnu.org
list for this kind of thing, or a general C programming forum.
Thanks,
Jonathan
>
> #include <stdio.h>
>
> void func(char *ptr) {
> printf("\n%i",sizeof(ptr));
> }
>
> int main(void) {
> char arr[10];
> printf("\n Sizeof arr %i",sizeof(arr));
> func(arr);
>
> return 0;
> }
>
> /* sizeof(arr) != sizeof(ptr), but they point to same thing. */
>
>
> So problem. On main, arr has size 10, while on func, arr has size 8. But
> they are equal.
>
>
> --
> André Albergaria Coelho
> andrealbergaria@gmail.com
prev parent reply other threads:[~2023-11-21 11:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-21 2:30 André Albergaria Coelho
2023-11-21 6:05 ` Martin Uecker
2023-11-21 11:42 ` Jonathan Wakely [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAH6eHdT1mSaiKFRepFMM+ZiAa=Sj+qdjHvRjaM+-vaXsZfGCow@mail.gmail.com' \
--to=jwakely.gcc@gmail.com \
--cc=andre1coelho@outlook.com \
--cc=gcc@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).