mirror of
https://github.com/LCTT/TranslateProject.git
synced 2026-08-23 04:03:29 +08:00
Update 20220510 How to (safely) read user input with the getline function.md
修改格式
This commit is contained in:
@@ -26,10 +26,9 @@ As a simple example, we might ask the user a question and read the result into a
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int
|
||||
main()
|
||||
int main()
|
||||
{
|
||||
char city[10]; // Such as "Chicago"
|
||||
char city[10]; // Such as "Chicago"
|
||||
|
||||
// this is bad .. please don't use gets
|
||||
|
||||
|
||||
Reference in New Issue
Block a user