Hello everyone here below i have some code that intialisize an array with 4 elements but there is space for 50 elements.
Now i want that i can manually add some elements to the array but it doesn't work for me can somebody help me? like here i want to add Sander to the 5th element.
#include <stdio.h>
int main()
{
int i;
char *arr[50] = {"C","C++","Java","VBA"};
char *(*ptr)[50] = &arr;
(*ptr)[5]="Sander";
for(i=0;i<5;i++)
printf("String %d : %s\n",i+1,(*ptr)[i]);
return 0;
}
Thx a lot
(*ptr)[4]:) Remember that array indexing is zero-based.sizeofbut that wasn't correct