Set i-th of array pointer as variable in c -


i wondering there way set i-th or string in pointer array local variable?

for example

char = "string"; char b = "string2"; char *args[3]; args[0] = a; args[1] = b; args[2] = null; 

therefore,

agrs = {"string","string2",null}; 

thanks!

yes , can not have right . a , b has declared correctly-

char *a = "string";                //string literal (constant) char *b = "string2";               // or write char b[] = "string2";  char *args[3]; args[0] = a; args[1] = b; args[2] = null; 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -