7

question in gdb

view full story
linux-howto

http://ubuntuforums.org – Hello, I wrote this simple program which prints all the arguments given to a program. My code is straightforward and this is it Code: #include <stdio.h> #include <malloc.h> int i = 0; int main(int argc, char** argv) {  printf("\nargc == [%d]",argc);  printf("\nthe arguments are ");  for(i=0;i<argc;i++)  {   printf("\nargv[%d] == [%s]",i,*(argv+i));  }  return 0; } And this is what I see in gdb Code: argc == [4] the arguments are argv[0] == [/home/Desktop/gdb/five/a.out] argv[ (Hardware)