Skip to content

Instantly share code, notes, and snippets.

@s3va
Last active December 19, 2021 21:35
Show Gist options
  • Save s3va/8735d4557ac63850f46a4fbf6afb21ef to your computer and use it in GitHub Desktop.
Save s3va/8735d4557ac63850f46a4fbf6afb21ef to your computer and use it in GitHub Desktop.
confusion with asterisks and ampersands
#include <stdio.h>
int main(int argc,char **argv){
printf("%d\n",argc);
puts(*argv);
printf("%p\n",*argv);
if(argc>1){
puts(*(argv+1));
printf("*** %p\n",*(argv+1));
printf("[[[ %p\n",argv[1]);
}
for(char** s=argv ; s<argv+argc; *s++){
printf("ppppp %p\nssssss %s\n",*s,*s);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment