Hello friends,
I was trying to brush my programing skill and was not able to get answer of "why array size is different inside function solution1?" Inside main, size of array is 11 but inside solution1 its size is just 2.
Here is my code...
#include <iostream>
#include <stdio.h>
using namespace std;
void solution2(int array1[], int number)
{
}
void solution1(int array1[], int number)
{
printf("solution1::size of array1(%Zu) and number is(%d)\n", sizeof(array1)/sizeof(int), number );
}
int main()
{
int number = 10;
int array1[] = {1,2,5, 6, 4, 9, 8, 22, 13, 3, 7};
printf("size of array1(%Zu) and number is(%d)\n", sizeof(array1)/sizeof(int), number );
solution1(array1, number);
return 0;
}
2,18 Top