在C语言中,使用 char text[100]; 分配一塊內存區域時,只是分配了100個byte的內存,而並沒有爲text分配一個char*類型的變量內存,如果我們用 &text 取text的地址,會發現它就是text本身,這就證明了沒有爲text分配一個指針變量的內存。必須用char *text2=text; 才能將text所在的地址寫入內存的指針變量中,然後用&text2才能取到char**類型的指針。如果想當然的用&text,得到的實際上是一個char*類型的變量,它的值與text相同。153Please respect copyright.PENANAi1o3sD8F6a
arrow_back
明慈淨行記
more_vert
-
info_outline Info
-
toc Table of Contents
-
share Share
-
format_color_text Display Settings
-
exposure_plus_1 Recommend
-
Sponsor
-
report_problem Report
-
account_circle Login
Search stories, writers or societies
Continue ReadingClear All
What Others Are ReadingRefresh
X
Never miss what's happening on Penana!
明慈淨行記
Author:
淨明

ISSUE #58
第58章 《Coding Art》第13篇 char text[100];並沒有爲text單獨分配一個指針類型的變量內存
LIKES 0
READS 149
BOOKMARKS 3
campaign
Request update 0
Sponsor
Suggest Edits

Click to load the next chapter
X
After each update request, the author will receive a notification!
smartphone100 → Request update
X
Sponsor again
Click to login
Login first to show your name as a sponsor.
Thank you for supporting the story! :)
Please Login first.
×
Write down what you like about the story
×
Reading Theme:
Font Size:
Line Spacing:
Paragraph Spacing:
Load the next issue automatically
Reset to default
×
People Who Like This