From 97ee76a6bb58ac340629c077a863746375271c4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AD=E5=BC=80=E7=AE=B1?= Date: Tue, 10 May 2022 16:08:49 +0800 Subject: [PATCH] Update 20220510 How to (safely) read user input with the getline function.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改格式 --- ... to (safely) read user input with the getline function.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sources/tech/20220510 How to (safely) read user input with the getline function.md b/sources/tech/20220510 How to (safely) read user input with the getline function.md index 4d49ccbd93..46f51fe62c 100644 --- a/sources/tech/20220510 How to (safely) read user input with the getline function.md +++ b/sources/tech/20220510 How to (safely) read user input with the getline function.md @@ -26,10 +26,9 @@ As a simple example, we might ask the user a question and read the result into a #include #include -int -main() +int main() { -  char city[10];                       // Such as "Chicago" +  char city[10]; // Such as "Chicago"   // this is bad .. please don't use gets