You need to use C language to implement the following functions: reference books?
Source: Internet
Author: User
To connect to the mysql database, run external programs, read the json or xml data returned by the website, you only need to run the command line operation without the window interface, and finally generate the exe executable file (single file, it is best not to have dll files. It is better to publish the linuxmac command line tool at the same time. The current level is that tan haoqiang's C language has been tested for more than 90 times. In addition, I have no contact with anyone else. Thank you for choosing the teaching material. To connect to the mysql database, run external programs, read the json or xml data returned by the website, you only need to run the command line operation without the window interface, and finally generate the exe executable file (single file, it is best not to have dll files. It is better to publish the command line tool for linux/mac versions at the same time. The current level is that tan haoqiang's C language has been tested for more than 90 times. In addition, I have no contact with other tools, thank you. Reply content: Simple, as long as LZ can ensure that your C language syntax is correct, the rest is about calling the function.
-------------------------------------
1. Connect to MySQL
This may be something simple,
1. Download the connector for Mysql C. This is a suite.
MySQL: Download Connector/C
2. Read and simulate writing and reading database code
MySQL: MySQL Connector/C Developer Guide
I have always believed in the official documentation... At least there will be no many errors, and many online articles are based on plain text.
-------------------------------------
2. Run external programs Supplement:
There are about three types of external programs:
1. System () function
This function can execute a line of Shell commands in Linux. Therefore, it is difficult to learn Shell skills in terms of compression and decompression.
2. APIs or libraries
Can call other programs provided by the api or library, such as PDF online there are a lot of mature library, such as: http://www.pdflib.com/
3. Reference of similar languages
DLL calls and so on. Java can call class, but this is generally well written. This is actually quite similar to 2.
For example, the communication between different languages is like stack calling, which is really annoying. do not consider it for the time being.
-------------------------------------
3. Reading json or xml data from the website
JSON or XML is a group of data generated after client access. So there are three steps.
1. Simulate HTTP sending or call Webservice.
This step is complicated for LZ. I can only give a thought and use socket to simulate HTTP requests.
2. Accept the request
This is much simpler. If we have done this, we only need to extract the desired part based on the returned data.
2.1 JSON data
To reduce the need for LZ to write the database by itself, JSON is recommended:
JSON
Like MYSQL, read the document and write it right away.
2.2 XML data
Http://xmlsoft.org/ This is really not used. · LZ. Try it.
------------------------------------
Fourth, I really don't know about the GUI. Fortunately, you didn't ask!
------------------------
Supplement:
LS is also good. In fact, advanced languages are more suitable for you, and C is really tired. I think using Python is faster. This kind of thing doesn't need my big PHP. I'm sorry for the subject. I ensure that all the requirements of the subject are met, and PHP has a lower barrier than Python. Is this a course design? It is still a bit difficult to use C.
You can use four libraries to complete the function:
Libmysqlclient -- connect to the database
Libcurl -- read a website
Cjson-Parse json data
Libxml2 -- Parse xml data
Run the external program and directly fork + execve/system.
The module organization should be designed first, and the functional steps should be clear and the directory structure and makefile should be organized. Well, let's get started. C language is also capable of doing big things. It's very suitable for you. The subject says you want to use C. What do you do to educate others?
Add lib, google
Or search site: http://stackoverflow.com C. mysql json. Based on your current experience, using PHP to do this requires 2 or 3 days of work.
C/C ++, Java? In less than two or three months, you may not be able to implement the C language completely, but it usually depends on some libraries. However, I think it is meaningless to use C to implement these functions. As mentioned above, Python is faster and more powerful. I am also connecting JSON and MySQL, using Python.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service