20165210 Learning Basics and C-language basic survey

Source: Internet
Author: User

20165210 Learning Basics and C-language basic survey I. Skills learning process and experience

Read Lou Teacher "do high school" oneself or deep feeling, for sports, music, chess card will be a little, I think doing secondary school can be summed up as three points: do, learn, learn to do the combination, so-called to do is practice, repeated to practice, and learn is learning, but this is not pure learning, but in the study of thinking, The last thing to learn is to apply the things you think and learn to practice.

In my primary school, I have learned a period of erhu, but "more than 90%" people that should be no, but the process of learning and experience want to share with you, because my mother is particularly fond of national musical instruments, so I started from primary school on the contact with national musical instruments, erhu Ah, gourd silk ah and so on, Erhu is the longest learning is also the most touching, the beginning of no fingering practice, only a few pull the bow practice, learning is also more boring, there is no mood to practice, sometimes go to sometimes do not go, do not practice the result is to keep up with the rhythm of the teacher, it is aware that should be taken seriously, then every morning to learn, Also to learn in the afternoon, go home at night to practice a while, the fingers trained hand cocoon, the formation of muscle memory, the beginning of the practice are some of the basic things, and then to learn some skills, it is also necessary to start thinking, in the practice need to summarize how to use the simple fingering and how to use a simple method of change, in the practice You'll get the most out of your exams.

体育运动的初学者练习时候都需要重复动作,比如「学习打乒乓球时」要练习挥拍,挥拍成千上万遍之后动作就会定型,也就是教练常说的「肌肉有了记忆能力」,以后实战中可以不假思索地做出来。

Practice is still necessary, in the secondary school, because of academic reasons, I did not insist on learning erhu, which is also I regret a thing, but this thing always reminds me, do everything to go to practice, so in the actual combat can be done without hesitation.

II. Basic Survey of C language
    1. How do you learn C language? (Homework, experiment, textbook, others), what are the experiences and lessons of C language learning compared to your superb skills?
    • Because the foundation is very poor, so in the C language of the previous holiday began to understand the internet, but not very understand, and then have a textbook and the teacher's explanation, slowly began to get started, and then have the operating system, more practice, know more and more, C language learning must practice, do more questions, will not be going to check, I'm going to ask.
    1. How many lines of C code have you written so far? What is the understanding? Quantitative change caused qualitative change, how to balance the quality and quantity?
    • Probably wrote more than 3,000 lines of code, more than half can understand, in the course of practice must grasp the amount, quantity is not good, long but not understand is useless, not only to practice, but also in the practice of middle school, to master.
    1. Learned the C language, you divide the array pointer, pointer array, function pointer, pointer function these concepts? ((X[4]) ()) [4] What is the X in this statement?
    • Array pointers:

      指向数组的指针:int (*p)[10];
    • Array of pointers:

      每个元素都是指针:int *p[10];
    • function pointers:

      指向函数的指针变量:int (*p)[int x];
    • pointer function:

      返回类型是指针的函数:int *p[int x];
    1. Have you learned the C language, do you understand the differences and connections between files and streams? How do I differentiate between text files and binaries? How do I programmatically manipulate these two files?
    • No contact, but only a little impression of the document, I went online to check some information, distinguish between text files and binary files
    1. Have you learned C language, do you know what is process-oriented programming? What is the way it solves the problem?
    • The process is focused on the process, regardless of the object.
    1. What is a module in C language? Have you ever written a program for multiple source files?
    • I think the module is also a file, not currently written.
    1. Have you learned the C language, do you know what is "high cohesion, low coupling"? How does this principle apply to high-quality programming?
    • Not very clear, I checked the internet, cohesion poly low coupling.
    1. Having learned C, how do you copy the contents of array A into array B? How do I find the number 5 in an integer array a? How do I sort an integer array a (small to large, from large to small)? Write the appropriate program.
    • Copy the contents of array A to array B:
#include <stdio.h>#define n 7int main(){    int a[n]={3,9,9,0,0,5,6},b[n];    int i;    for(i=0;i<n;i++)    {        b[i]=a[i];        printf("%d",b[i]);    }    return 0;}
    • Find the integer array A with no number 5:
#include<stdio.h>int main(){    int a[8]={2,3,6,5,8,9,7,4};    int i;    for(i=0;i<8;i++)    {        if(a[i]==5)        {            printf("have five\n");            break;        }    }    return 0;}
    • To sort array A:
#include<stdio.h>int main(){int a[10],i,j,t;printf("请输入10个整数:\n");for(i=0;i<10;i++){    scanf("%d",&a[i]);}for(i=0;i<9;i++){    for(j=0;j<9-i;j++)    {       if(a[j]>a[j+1])       {           t=a[j]; a[j]=a[j+1]; a[j+1]=t;       }    }}printf("排序以后的数:\n");for(i=0;i<10;i++){    printf("%d ",a[i]);} return 0;}
    1. Write a program to count how many lines of code have you written in C?
    • Because the study is not fine, Baidu to research a bit, calculate the code
#include <stdio.h> #include <Windows.h> #include <string.h>int main () {char filepath[1000], batpath[ 1010];    The absolute path of a file folder and a. bat file.    Gets (filepath);//input absolute path of a file folder strcpy (Batpath, filepath);    strcat (Batpath, "\\Text1.bat");    FILE *FP;    fp = fopen (Batpath, "w");    Fputs ("DIR *.c/b>list.txt", FP);    Fclose (FP);     System (Batpath); /*~~~the end of creating file name list~~~*//*~~~the beginning of Get. c file name from list~~~*/static INT co     UNT = 0;    FILE *FP1, *FP2;    FP1 = fopen ("List.txt", "R");    Char s[100];    Char singleline[1000];        while (Fgets (S, D, FP1))//get one line from list, each line refers to a. c file name {int len = strlen (s);        if (s[len-1] = = ' \ n ') s[len-1] = ' + ';          printf ("%s:", s);                FP2 = fopen (S, "R"); /*~~~the beginning of counting lines of code~~~*/while (Fgets (Singleline,, FP2))//open the CorRect file, according to the file name {count++;        } printf ("%d\n", count);    Fclose (FP2);    } printf ("\ n");        Fclose (FP1);    System ("pause");   return 0;}

Reference: Zcplayground
But there are a lot of code is not very clear, I hope to continue efforts.

    1. Do you know what a breakpoint is? Give an example of your own debug program.
    • Set breakpoints in a single debug, the next time just let the program automatically run to set the breakpoint location, you can break down the location of the last breakpoint, greatly facilitates the operation, while saving time.

      Java Chapter Issues
    1. What is the relationship between Java bytecode and Java Virtual machine and Java runtime?
    2. What are the differences between the two floating-point types?
    3. Return and break, continue difference?
    4. What exactly does a class file object mean?
    5. What is the difference between abstract and class?
    6. Interface is not a class?
    7. is the member variable of an outer-nested class valid only in the inner class?
    8. is the StringTokenizer Class A classification of the string class?
    9. Is the window also a container class?
    10. What are the input and output streams related to each other?
    11. Does closing the connection affect the API database?
    12. When does the process use threads?
    13. How do I find the object for my socket?
    14. Does drawing an image include loading an image?
    15. What are the advantages of generics in a collection frame?

What specific goals do you have for the study of Java programming in comparison to the study of C language? How to improve the program design ability and develop the computational thinking through deliberate training? How do you achieve your goals through "doing middle school"?
Adhere to practice the code every day, be sure to understand the code of the practice, more on the Internet to find some information, hope to learn Java, can master the language, correct attitude, more thinking, more practice and more practices.

20165210 Learning Basics and C-language basic survey

Related Article

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.