Passing a string literal as a function parameter defined as a pointer

前端 未结 6 943
南旧
南旧 2021-02-05 20:19

I am reading the chapter on arrays and pointers in Kernighan and Richie\'s The C Programming Language.

They give the example:

/* strlen:  return         


        
6条回答
  •  孤街浪徒
    2021-02-05 20:49

    Does the function assign this string literal as the value of its local variable *s and then use s as the array name/pointer?

    Yes

提交回复
热议问题