This is the typical c code:
#include <stdio.h>
int main(int argc, char **argv)
{
}
**I wanted to make like this argv array. But I got error. How can I make an array like this. Here is my code:
#include <stdio.h>
int main(int argc, char **argv)
{
char **names = {"Prite", "Ridoy", "Ridhita"};
for (int i = 0; i < 3; i++)
{
printf("%s\n", names[i]);
}
}
I got this error:
$ make pointers
pointers.c:6:21: error: incompatible pointer types initializing 'char **' with an expression of type 'char [6]' [-Werror,-Wincompatible-pointer-types]
char **names = {"Prite", "Ridoy", "Ridhita"};
^~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 errors generated.
make: *** [<builtin>: pointers] Error 1