How to retrieve the data from domain_cx in domaine , once I'm in the function get_domaine(...) I have tried the following, but the result isnt what expected (0-2 instead of 0-2 3). Here is my code
#include <stdio.h>
#include <stdlib.h>
int get_domaine(char * domaine)
{
char (*ptr_dom)[10];
ptr_dom = (char (*)[10]) domaine;
printf("%s ", ptr_dom[0]); // will print
printf("%s ", ptr_dom[1]); // will not print even thought there is data.
return 1;
}
int main(int argc,char * argv[])
{
char *domaine_cx[10];
domaine_cx[0] = "0-2";
domaine_cx[1] = "3";
if(get_domaine((char *)*domaine_cx)) printf("Ok");
return EXIT_SUCCESS;
}