20165103 Learning Basics and C-language basic survey

Source: Internet
Author: User
Tags strcmp

20165103 Learning Fundamentals and C language Basic survey learning Fundamentals and C language Basic survey skills and their learning experience

In reading the teacher to do a series of high school articles, read a sentence:

The cause of the development of Poles is mainly personal interests and job needs.

--Quoting from the practice course of Wubi input method of middle School

Review of their continuous learning practice process, their own knowledge of the better, most of the skills are due to their own interests coupled with the need for work to gradually grasp the steps. Among the few skills that have been mastered recently, the skill of Taiji has barely reached a higher level.

Introduction to learning Experience
    1. First or because of the traditional martial arts have a certain interest, and can exercise the body, then decided to join the school community, began to learn Taijiquan.
    2. At first, we first learned about the history of Taijiquan and the positive effects that can be produced by Taiji, at the same time, we understand the precautions in Tai Chi exercise.
    3. Just started to learn the basic Taiji young footwork, some basic Taijiquan stand.

      Learning process

      I study in the whole process of Taijiquan is broadly divided into 4 stages:

    • The first stage: Learn the action of each style in the routine. As many traditional martial arts will be divided into many types of routines, in fact, the whole routine is divided into a number of modules, and I learned the first step is to learn a single module. Here, we use the method of reviewing on the basis of learning to ensure the proficiency of previous movements.
    • Stage Two: Control the body to make the movements coherent. This stage is equivalent to the debug in the program design, the ultimate goal is to allow the entire movement to complete smoothly. Here because of their own physical coordination ability is OK, carried out more smoothly.
    • The third stage: the optimization of the action. This stage can also be considered as the optimization of the program. Through the corrective action, constantly out of the comfort zone, strengthen their ability to control the body, so that the movement norms and aesthetics.
    • Stage four: In the constant deliberate training to experience its verve. For nearly one months, the same set of actions is repeated 20 times a day, and the process of movement is also rehearsed in the mind during leisure time. Through the constant analysis of the movement of its motion logic, improve their own movements, adjust the state of the body, and finally the whole set of moves to explore the verve gradually.

      Experience
    • In the process of continuous learning, perseverance is a very important link, in the physical exercise, the basic skills only through the daily exercise can be improved, constantly overcome the physical discomfort and reasonable time to arrange. At the end of the continuous repetition of training, but also to overcome the mental burnout.
    • In the learning time should pay attention to deliberate practice, do not do simple low-quality repetitive work.
    • Feedback is important, and it is through constant feedback that you can find out where the problem lies, and then think about how to solve it.

      C Language Basic Survey 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?

C language learning from the big one semester, "Basic program Design," the course began to learn, the main learning method is to read the contents of the textbook in class, listening to teacher Xu teachers need to pay attention to the knowledge points. The main way of learning is through the teacher, students give the topic, programming, through a single step to understand the relevant knowledge.
Different from Taijiquan, in C language learning needs to be better organized and clear thinking, but also to consider the key content of learning. Because C language learning is more emphasis on the teacher's experiment and homework, so in many more practical sections of the study of insufficient. (such as: Linked list, bit operations, file operations) at the same time, because there is a semester without a lot of programming, a part of the knowledge has been forgotten signs. In addition, there is the problem that the code in the book cannot be used quickly and accurately when it is detached from the books.

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?

So far, the estimate has been written down with 3000 lines of code. In the basic statement of the preliminary understanding, the partial operation, the library function understanding is not sufficient, in the continuous further study. I think, on the basis of reaching a certain amount, should be through the accumulated amount, constantly through their own use to improve in terms of quality.

Learned the C language, you divide the array pointer, pointer array, function pointer, pointer function these concepts?

For some concepts, previous studies have been studied in order to distinguish these concepts. The concepts can be distinguished, but they are unfamiliar to use because they are not used when writing code. In layman's terms, the = = Array pointer = = is a pointer to the first address of the array, which is often used when manipulating a single-dimensional array using pointers. = = Pointer Array = = is an array of pointers of the same type, which is an array of pointers, mainly used for processing multidimensional arrays. The = = function pointer = = is a pointer to the first address of the functor, and its declaration is usually as follows:

int (*f)(int a);/*声明一个函数指针*/f=func;/*函数首地址赋给指针*/

= = Pointer function = = is a function whose return value is a pointer. The statement reads as follows:

int *f(int a);/*声明一个整型形参且返回值为整型指针的指针的函数*/
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?

The differences and connections between files and streams really do not understand, read some of the information on the two have a superficial understanding. A file is a collection of externally related data that is viewed as a unit. And I see that the explanation of convection is a stream of data, a sequence read in a prescribed sequence, and a stream is an object of a class, and the input and output of many files are implemented by invoking the member functions of the class. In file I/O transfer, the file direct transfer process takes up more cores, while the stream can be used as a buffer, thus reducing system calls.
The essential difference between a text file and a binary file is that the numerical data is stored in a binary file, where the numeric file is stored as a binary file, and the text file is stored in the ASCII code of the numeric data. Text files can be opened by fopen (), parameters can be a +, w+, r+
Binary files can be opened with fopen (), Parameters ab+, wb+, rb+
Writing to a file can be in either fprintf () or fwrite () mode.

Have you learned C language, do you know what is process-oriented programming? What is the way it solves the problem?

Its own understanding is that process-oriented programming is centered on the process of the whole procedure, and the procedure is carried out in the context of what is happening and handled, not in order to fit the design of the specific object. The problem-solving method is to classify the problem, get the structure diagram that can reflect the relationship between the modules, then program it through the modular programming, and finally connect the modules by the relationship.

What is a module in C language? Have you ever written a program for multiple source files?

Here I understand the module as constituting a few smaller parts of a large project, each of which performs its own functions, each of which constitutes the execution of the overall project. In the previous learning process has not written multiple source files of the program, in the current situation, need to further study the relationship between documents and use.

Have you learned the C language, do you know what is "high cohesion, low coupling"? How does this principle apply to high-quality programming?

Cohesion is a measure of how closely the process processes in a program are related. Cohesion means a high degree of compactness in the process between the modules in the system. Coupling is the degree to which the two modules are tightly bound to each other. The tighter the coupling between the two modules, the poorer their independence. What we need is a high degree of independence between the modules, which facilitates the connection between modules. High-quality program, the module processing process is compact, each module is binding to a low degree of "high polymerization, low coupling." In the program design, it is possible to achieve high cohesion and low coupling by simplifying the main program and using the function to realize the modularity.

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.

The procedure is as follows:

#include <stdio.h> #include <stdlib.h> #include <string.h>int input (int b[],int c), int output (int e[], int c); int copy (int a[],int d[],int n); int cmp (const void *p, const void *q); int cmp1 (const void *p, const void *q); int Ma    In () {int n,k=5;    int *p;    int a[100],d[100];    printf ("Number of numbers in the input array");    scanf ("%d", &n);    Input (a,n);    Copy (a,d,n);    Output (a,n);    Output (d,n);    Qsort (a,n,sizeof (int), CMP);    Output (a,n);    Qsort (d,n,sizeof (int), CMP1);    Output (d,n);    p = (int *) bsearch (&k,a,n,sizeof (int), CMP); (p = = NULL)?    Puts ("Not found"): Puts ("found"); return 0;}    int input (int b[],int c) {int i;    for (i=0;i<c;i++) {scanf ("%d", &b[i]); } return 0;}    int output (int e[],int c) {int i;    for (i=0;i<c;i++) {printf ("%d", e[i]);    } printf ("\ n"); return 0;}    int copy (int a[],int d[],int n) {int i;    for (i=0;i<n;i++) {d[i]=a[i]; } return 0;} int cmp (const void *p, const void *q) {return STRCMP ((char *) p, (char *) q);} int cmp1 (const void *p, const void *q) {return strcmp ((char *) q, (char *) p);}

This program is written by my further learning part of the function. Sorting and finding can also be programmed in a more primitive way.

Write a program that counts how many lines of code your C language has written.

To tell the truth, seeing this is really not, just a simple idea is to traverse the computer fixed files in the. c Suffix of the file, and then count the number of lines to go blank line, surf the internet for a bit, a general understanding of a bit. Further study is needed on this.

#include<stdio.h>#include<Windows.h>#include<string.h>int main(){    char filepath[1000], batpath[1010];    gets(filepath);    strcpy(batpath, filepath);    strcat(batpath, "\\Text1.bat");    FILE *fp;    fp = fopen(batpath, "w");    fputs("DIR *.c /B>list.txt", fp);    fclose(fp);    system(batpath);    static int count = 0;    FILE *fp1, *fp2;    fp1 = fopen("list.txt", "r");    char s[100];    char singleline[1000];    while(fgets(s, 100, fp1))    {        int len = strlen(s);        if(s[len-1] == ‘\n‘) s[len-1] = ‘\0‘;        printf("%s: ", s);        fp2 = fopen(s, "r");        while(fgets(singleline, 1000, fp2))        {            count++;        }        printf("%d\n", count);        fclose(fp2);    }    printf("\n");    fclose(fp1);    system("pause");    return 0;}
Do you know what a breakpoint is? Give an example of your own debug program.

Breakpoints I usually use to set breakpoints when debugging, after setting breakpoints, the debugger will break at the running breakpoint. Usually, because there are many previous programs, the breakpoint is set when there is a loop, and then you start one step at the end of the breakpoint to find the problem.

Each chapter raises a question

Chapter One: Does the platform independence of Java be understood as Java comes with a virtual machine that translates Java code for different platforms?
Chapter Two: Why can an int declaration also be like "average = 9898"?
Chapter III: INSTANCEOF Can I simply understand whether the current object is an object in a collection (library)?
The fourth chapter: is the object limited to its own exclusive class? What is the relationship between the variables and methods in the object class?
Fifth: Inheritance of subclasses that is, if you want to use the methods and member variables in the parent class, you do not need to rewrite, directly use? Is it not necessary to override the parent class when creating an object?
The sixth chapter: whether the design of the interface can be a non-homogeneous arbitrary link in satisfying the condition?
The seventh chapter: the function of the assertion statement is not in the final program output phase can be removed? That is, the function of the assertion statement is used to debug the program is as a guarantee?
Eighth: Does the string class run as a call to the library function?
The Nineth chapter: How to bind the keyboard to distinguish with the side key keyboard and without side key keyboard?
The tenth chapter: why the buffer stream is more efficient than the direct operation of the file, where can this idea of flow be applied?
11th: Can the data call in the MySQL library be seen as an enlarged version of the library in C? What can be called specifically in the library?
The 12th chapter: How to use multi-thread how to embody high cohesion's thought better?
The 13th chapter: whether the process of the socket link will appear several same programs at the same time linked to the situation?
The 14th chapter: How to control the display resolution of the image when processing the image?
The 15th chapter: This chapter is closely related to the data structure, is the tree set and the linked list an efficient project structure?

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"?

My goal in Java programming is to learn to use Java and to do some small projects. Through deliberate training to improve the program design ability should start from the foundation, first of all learn the basic knowledge, and then in a constant attempt to learn, out of the comfort zone, committed to solving problems, problem-oriented Java learning.

20165103 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.