Skip to content

Instantly share code, notes, and snippets.

@vladfulgeanu
Created June 11, 2012 10:34
Show Gist options
  • Save vladfulgeanu/2909490 to your computer and use it in GitHub Desktop.
Save vladfulgeanu/2909490 to your computer and use it in GitHub Desktop.
vector of strongs/ char matrix
#include <stdio.h>
#include <string.h>
void print(char ** x){
for(int i = 0; i < strlen(x); i++)
printf("%s\n", x[i]);
}
int main(){
char **x = {"ana", "are", "mere"};
print(x);
getchar();
return 0;
}
@edymanoloiu
Copy link

Functia print nu este intentata, in rest pare ok.

@cosmin1123
Copy link

missing indentation
it's compilling but it has a lot of warnings and it gives seg fault
line 3 : you have to keep the number of lines of your matrix char *x[3]
line 4 : tab and strlen does not work on a matrix .
line 5 : double tab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment