I asked a few questions here by now, and people don't like them, so I'll make it short.
I have tried to make a dynamically allocated array of int, and then I wanted to assign it a constant array just for test, and I couldn't do it.
When we want to create an array of chars we write: char *arr = "abc";
It didn't work like this: int *arr = {1,2,3};
but it did work when I did that: int *arr = (int[]) {1,2,3};
honestly I don't know how that cast did the job, and I was happy, until I tried to get the number of elements: int n = sizeof(arr)/sizeof(int);
How does the cast make it work?
How to pass that array to sizeof()?
Thank you.