Printing pointer addresses in C [two questions]

前端 未结 5 874
感动是毒
感动是毒 2021-01-04 14:02

I know that my questions are very simple but googleing them didn\'t get me any useful results... They\'r probably too simple!!

No. 1

char* createStr(         


        
5条回答
  •  梦谈多话
    2021-01-04 14:28

    For the second exemple : *argv[1] is a char * (i.e "3" )
    If you want to display "3" you have to use printf("%s\n", *argv[1]); or get an integer from the string using atoi().
    Maybe you can even try to write your own version of atoi()!

提交回复
热议问题