+ 1
C Calloc Fix Correct?
I found a mistake in the C teaching course and fixed it here is how i did it https://code.sololearn.com/cVS6X7en21VW/?ref=app
5 Respostas
+ 2
Fabian G. But the one in the course works fine and why do you even need to assign a size to the array when you are initializing it right there.
Don't you think this works?
#include <stdio.h>
int main() {
int arr[] = {1,2,3,4,5};
int size = sizeof(arr)/sizeof(arr[0]);
for(int i=0;i<size;i++){
printf("%d ",arr[i]);
}
return 0;
}
+ 2
Avinesh ye ty
+ 1
Fabian G. Come on man that's fine. Atleast now you learnt something that hopefully you would remember.
0
It didnt work for me in the course so i tried fixing it and then it worked for me