Traditional Culture Encyclopedia - Weather inquiry - How does C system return the value?

How does C system return the value?

Do you want to get the weather forecast through curl?

The first method:

Output the information obtained by curl to a file, and then analyze the contents in this file. This method is relatively simple:

system(" curl/data/sk/ 10 10 10 100 . html-s-o weather . txt ");

Then judge whether the information is successfully downloaded to weather.txt by the return value of the system. If successful, please open the file yourself and analyze its contents.

The second method does not call the system function. Use pipeline treatment. For example, MSVC's _popen function.

In order to do better, learn json.