How are my arrays modified when C passes by value?

后端 未结 4 844
傲寒
傲寒 2021-01-23 10:15

I made a simple program in C to check if two words are anagrams. My question is that if I\'m passing word_one and word_two as parameters, doesn\'t that mean that I\'m not modify

4条回答
  •  青春惊慌失措
    2021-01-23 10:42

    Arrays are reference types in C. If a function takes an array, it will be passed a pointer, and any changes you make to it will also affect the original array.

提交回复
热议问题