Skip to main content
deleted 5 characters in body
Source Link
Lundin
  • 219.9k
  • 47
  • 282
  • 446

No, An array-type is implicitly converted into pointer type when you pass it in to a function.

So,

void PrintSize(int p_someArray[10]) { printf("%zu\n", sizeof(p_someArray)); } 

and

void PrintSize(int *p_someArray) { printf("%zu\n", sizeof(p_someArray)); } 

are equivalent. So what you get is the value of sizeof(int*)

No, array-type is implicitly converted into pointer type when you pass it in to a function.

So,

void PrintSize(int p_someArray[10]) { printf("%zu\n", sizeof(p_someArray)); } 

and

void PrintSize(int *p_someArray) { printf("%zu\n", sizeof(p_someArray)); } 

are equivalent. So what you get is the value of sizeof(int*)

An array-type is implicitly converted into pointer type when you pass it in to a function.

So,

void PrintSize(int p_someArray[10]) { printf("%zu\n", sizeof(p_someArray)); } 

and

void PrintSize(int *p_someArray) { printf("%zu\n", sizeof(p_someArray)); } 

are equivalent. So what you get is the value of sizeof(int*)

added 10 characters in body
Source Link
Iharob Al Asimi
  • 53.1k
  • 6
  • 66
  • 100

No, array-type is implicitly converted into pointer type when you pass it in to a function.

So,

void PrintSize(int p_someArray[10]) {  printf("%zu\n", sizeof(p_someArray)); } 

and

void PrintSize(int *p_someArray) {  printf("%zu\n", sizeof(p_someArray)); } 

are equivalent. So what you get is the value of sizeof(int*)

No, array-type is implicitly converted into pointer type when you pass it in to a function.

So,

void PrintSize(int p_someArray[10]){ printf("%zu\n", sizeof(p_someArray)); } 

and

void PrintSize(int *p_someArray){ printf("%zu\n", sizeof(p_someArray)); } 

are equivalent. So what you get is the value of sizeof(int*)

No, array-type is implicitly converted into pointer type when you pass it in to a function.

So,

void PrintSize(int p_someArray[10]) {  printf("%zu\n", sizeof(p_someArray)); } 

and

void PrintSize(int *p_someArray) {  printf("%zu\n", sizeof(p_someArray)); } 

are equivalent. So what you get is the value of sizeof(int*)

deleted 3 characters in body
Source Link
Prasoon Saurav
  • 93.3k
  • 51
  • 245
  • 348

No, an array-type is implicitly converted into pointer type when you pass it in to a function.

So,

void PrintSize(int p_someArray[10]){ printf("%zu\n", sizeof(p_someArray)); } 

and

void PrintSize(int *p_someArray){ printf("%zu\n", sizeof(p_someArray)); } 

are equivalent. So what you get is the value of sizeof(int*)

No, an array-type is implicitly converted into pointer type when you pass it in to a function.

So,

void PrintSize(int p_someArray[10]){ printf("%zu\n", sizeof(p_someArray)); } 

and

void PrintSize(int *p_someArray){ printf("%zu\n", sizeof(p_someArray)); } 

are equivalent. So what you get is the value of sizeof(int*)

No, array-type is implicitly converted into pointer type when you pass it in to a function.

So,

void PrintSize(int p_someArray[10]){ printf("%zu\n", sizeof(p_someArray)); } 

and

void PrintSize(int *p_someArray){ printf("%zu\n", sizeof(p_someArray)); } 

are equivalent. So what you get is the value of sizeof(int*)

added 2 characters in body
Source Link
Prasoon Saurav
  • 93.3k
  • 51
  • 245
  • 348
Loading
Rollback to Revision 9
Source Link
Prasoon Saurav
  • 93.3k
  • 51
  • 245
  • 348
Loading
Rollback to Revision 7
Source Link
Prasoon Saurav
  • 93.3k
  • 51
  • 245
  • 348
Loading
added 4 characters in body; Post Made Community Wiki
Source Link
Prasoon Saurav
  • 93.3k
  • 51
  • 245
  • 348
Loading
added 7 characters in body
Source Link
Prasoon Saurav
  • 93.3k
  • 51
  • 245
  • 348
Loading
added 1 characters in body
Source Link
Prasoon Saurav
  • 93.3k
  • 51
  • 245
  • 348
Loading
deleted 1 characters in body
Source Link
Prasoon Saurav
  • 93.3k
  • 51
  • 245
  • 348
Loading
edited body
Source Link
Prasoon Saurav
  • 93.3k
  • 51
  • 245
  • 348
Loading
edited body
Source Link
Prasoon Saurav
  • 93.3k
  • 51
  • 245
  • 348
Loading
deleted 2 characters in body
Source Link
Prasoon Saurav
  • 93.3k
  • 51
  • 245
  • 348
Loading
added 3 characters in body
Source Link
Prasoon Saurav
  • 93.3k
  • 51
  • 245
  • 348
Loading
Source Link
Prasoon Saurav
  • 93.3k
  • 51
  • 245
  • 348
Loading