PHP programmers learn C language?

Source: Internet
Author: User
After learning the C language, I found that he could not do anything? Do you think learning C is helpful to PHP, or do you know that he cannot do anything after learning C language? Do you think learning C is helpful to PHP, or you can do something nice or interesting?

Reply content:

After learning the C language, I found that he could not do anything? Do you think learning C is helpful to PHP, or you can do something nice or interesting?

First, you can't do anything about the C language, but your application is incorrect. Second, for php, the C language can be used to expand it.

Let's take a look at this and use C/C ++ to expand your PHP

Since you are familiar with PHP, you should first play with CGI when you first touch the C language. It is actually very easy to play with CGI. Rename the executable file compiled belowtest.cgiPut it under the bin-cgi directory of the configured Apache, and then accesshttp://localhost/bin-cgi/test.cgiGood:

// cflags: -o /var/www/cgi-bin/test.cgi#include 
  
   #include 
   
    #include 
    
     int main(){    printf("Content-Type: text/plain\n\n");    char *qs = getenv("QUERY_STRING");    if(!qs) exit(-1);    char* equ = strchr(qs, '=');    if(equ) *(equ++) = '\0';    if(strcmp(qs, "name"))        printf("Parameters incorrect.");    else        printf("Hello Mr./Mrs. %s", equ);    return 0;}
    
   
  

Of course, optical c cannot do anything. You can write a console calculator at most.
C must be combined with the system api to do something. However, in the end, all these credits are from the system api, which has little to do with c.
Conclusion: You are right. You can't do anything after learning c.

You can write a database. Of course, this should be combined with the system API

After learning C, you will be able to understand the underlying layer of PHP, and better understand the principles of some things that are only known for use.

Why can't I do anything in C language? On the other hand, What can't I do with C language?
John Carma's game engine is pure C.
What can I do with C language? It's not important to learn programming. C helps you fully understand the memory ~ Thoroughly learn how to think about problems from a procedural perspective ~
This is the most important thing.

You should ask: how can we use c to do things?
Php is written in c. What do you say?

Use the appropriate language to do the right thing
C language is particularly suitable for writing operating systems and other places with High Performance Requirements
These places require that the C language runtime be as small as possible, so the C language can only use the standard library.
However, the api exported by the operating system is an excuse for C language.
Buy the first volume of advanced programming for unix networks or advanced programming for unix environments.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.