20165218 Learning Basics and C-language basic survey

Source: Internet
Author: User

Personal skills and reading experience
    • Painting of personal skills

Painting is the beginning of my contact from a very urine, from the original simple strokes to Chinese painting, sketching, gouache, about seven or eight years also studied. But after high school, they gradually put down.

I remember when I learned to sketch, the teacher's words let me remember, she said, drawing is to "copy": One is "copy" works, that is, copying, but "copy" The real Thing, because the sketch of the pursuit of the real , when can be placed on the table of still life intact "copy" To the paper, that level is the standard.

Copying is a very effective method of learning in a period of immature technology. Especially in the painting gouache, beginners difficult to master color skills, such as some green fruit dark face to use deep red, indigo processing, this for beginners, it is difficult to see from the real thing, and when copying, because there is a reference to the work, it is easier to color from the whole object to peel. Copying is not only a simple copy, it is a process of training skills, learning experience, and the mastery of theoretical knowledge. for the learning of programming language, this is equivalent to the beginning of the copy code, in the "copy" process to consolidate the theoretical knowledge, understand the use of the knowledge taught in class.

    • Reading and writing of personal skills

My writing skills are not a standout, but at least in high school, this is an addition to most of the people I lead. Reading and writing are the process of accumulation and application of knowledge, which is one in a sense.

Like painting, I started reading at a very young age. But to high school, because of school, but also because of the impact of mobile phones, my paper book reading greatly reduced, to the university and gradually regained. In my many ups and downs of the reading experience, my greatest experience is to find the right way.

High school, reading is often to accumulate writing material, exercise the sense of language, that is I read the paragraph, the sentence is worth recording, although some time-consuming, but the process can greatly deepen the memory, but also give people further opportunities to think, at the same time, this is also a process of practicing the word, can be more than one swoop.

By the time I was in college, I would use a "turnip book pick" app, which provided a scanning function that could capture text and scan records, and attach a module to write impressions, and finally create a complete book to save. This greatly saves the time of the excerpt. At the same time, the app also offers books, "Radish Pits" (similar to reading groups, can read together, pit Master bribed, etc.) and other functions. Use this app, while reading, at the same time to write down the feelings, but also to maintain the feel of writing. From last February to now, I have read 12.5 books, wrote 91 books, 2 essays. Looking at their own data, but also a small sense of accomplishment, more incentive to insist on reading.

    • Reading experience

After reading the teacher's blog, I remember the most profound is the teacher to do one thing when the purpose, systematic, summary. Regardless of weight loss, learning Wubi, back words, table tennis, Lou teacher in the process and after the end, will be systematically summarized, clear, stage clearly, this is I have never seen before.

A survey on C language learning
    • How do you learn C language?

To tell the truth, I do not do well in C language learning. The level stops at a relatively shallow degree. The process of learning is practice, and in the final review phase, I use a notebook to organize some confusing knowledge.

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

Estimates are about 3000 rows or more. Understanding the situation is more general, some knowledge points such as pointers and arrays, pointers and functions, file operations and so on only in the preliminary understanding phase, almost no practical programming operation.

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

An array pointer is a pointer variable that holds the first address of an array;
An array of pointers is an array of pointers with the same type of pointer, where each element is a pointer;
A function pointer is a pointer to a function, and a pointer to a function stores the entry address of a function in memory;
A pointer function is a function that returns a value as a pointer.

    • 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?
Files and Streams

A computer file is a collection of information stored on a computer as a carrier on a computer's hard disk. Files can be text documents, pictures, programs, and so on. Typically a named store on a disk. A stream is a transfer operation between data. Like what:

standard I/O flow : The transfer of information between memory and standard input, file I/O flow : Transfer of information between memory and external files, string I/O flow : Memory variables and the passing of information between a character array that represents a string stream.
--c++ Stream (Stream) Summary

The I/O function of the file is for the file descriptor, for example, when the call to open or other functions opened a file, return a file descriptor fd, and then for this FD for subsequent I/O operations, due to the need to repeatedly call the corresponding system calls, inefficient is natural.
While the flow of I/O functions is carried out around the stream, when using the stream I/O library to open or create a file, you can make a stream and a file, the next operation is to read and write the convection, positioning, etc., and finally closed. ...... The user can simply think of the stream as a memory buffer allocated by the operating system, where the data corresponding to the file is stored. --the difference between stream and file-csdn blog

I personally understand that flow is the carrier of the program input/output data process. The input/output devices and programs are connected.

Text files and binaries

There are two types of C language files, text files (also known as ASCII code files ) and binary files . The difference is in the way that numerical data is stored. In binary files, numeric data is stored in binary form, whereas in a text file, each array of numeric data is stored as a character and its ASCII code. Therefore, each digit in the text file occupies a single byte of storage space. The binary file is the entire number as a binary to store, not well-known each digit occupies a separate storage space.
--"C Language Programming (3rd edition)" P373

Programming editing
character meaning
"R" Open the text file as read-only, the file must be already present, and can only be read out, cannot write data, and if the file does not exist, an error occurs
"W" Create and open a text file in write-only mode, the existing file will be overwritten, and no matter whether the file exists, create a new text file, write the data only
A Open text file in write-only mode, position pointer moves to end of file, add data to tail of file, original file data is preserved; error if file does not exist
+ A combination of the preceding string, which indicates that the text file is opened as read-write, can be written to a file, or read from a file
"B" A combination of the above strings, which means opening the binary file

For example

fp=fopen("D:\\demo.txt","a+");

Indicates that the text file of D drive is opened read-write Demo.txt, retains the original content, and adds data to the tail;
and

fp=fopen("D:\\demo.bin","ab+");

Indicates that the binary file of D drive is opened read-write Demo.bin, preserving the original content and adding data to the tail;

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

I have not been exposed to this concept before, through the data, I understand that "process-oriented" is a process-centric programming thinking.

"process oriented" (Procedure oriented) is a process-centric programming idea. "Process-oriented" can also be called "record-oriented" programming ideas, they do not support rich "object-oriented" features (such as inheritance, polymorphism), and they do not allow the mixing of persistent state and domain logic.
is to analyze the steps required to solve the problem, and then use the function to implement the step by step, the use of a one-time call in turn. --oriented process _ Baidu Encyclopedia

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

Personal understanding of the module is a function, the main function of some of the more cumbersome, or the use of more than the number of parts written function convenient to call at any time. In the use of C language programming to solve the problem of cryptography mathematical basis of more.
I have no programs that have written multiple source files.

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

the principle of module decomposition is: High polymerization, low coupling, to ensure the relative independent type of each module. This principle should be followed for both structured and object-oriented approaches. High aggregation refers to the internal module of the closer the better, the stronger the better, simply say that the module function to be relatively independent and single, so that the module, each module only focus on one thing. Low coupling refers to the more loosely connected modules, the more the modules exchange only the information that must be exchanged to complete the system functions, which means that the simpler the interface of the module, the simpler the excuses, the less the variables and data exchanged between the modules and the outside world, which reduces the degree of interaction between the modules. --"C language Programming" P171

    • 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.
    1. Copy the contents of array a into array b
#include <stdio.h>#include <stdlib.h># define N 6int main(){    int a[N], b[N];    int i;    printf("输入数组a:");    for(i=0; i<6; i++)   //录入数组a的值    {        scanf("%d",&a[i]);    }    for(i=0; i<6; i++)  //将数组a的值复制到数组b中    {        b[i]=a[i];    }    printf("以下是数组b:\n");    for(i=0; i<6; i++)  //打印数组b    {        printf("%d\t", b[i]);    }}
    1. Find the integer array A has no number 5
#include <stdio.h>#include <stdlib.h>#define N 6int main(){    int a[N], b[N];    int i;    printf("输入数组a:");    for(i=0; i<6; i++)   //录入数组a的值    {        scanf("%d",&a[i]);    }    for(i=0; i<6; i++)  //将数组a的值复制到数组b中    {        b[i]=a[i];    }    printf("以下是数组b:\n");    for(i=0; i<6; i++)  //打印数组b    {        printf("%d\t", b[i]);    }}
    1. Sort integer array A (small to large, from large to small)
#include <stdio.h> #include <stdlib.h>void upsort (int a[],int m); void Printa (int a[],int m); void Downsort (    int a[], int m); int main () {int a[7]={12,67,3,78,36,90,40,2};    Upsort (a,8);    printf ("Ascending to:");    Printa (a,8);    Downsort (a,8);    printf ("\ n descending to:"); Printa (a,8);}    void Upsort (int a[],int m)//order sequencing {int i,j with select Sort method;    int k;    int temp;        for (i=0; i<m-1; i++) {k=i;        for (j=i+1; j<m; J + +) {if (a[j]<a[k]) k=j;            } if (i!=k) {temp=a[i];            A[I]=A[K];        A[k]=temp;    }}}void Printa (int a[], int m)//print array {int i; for (i=0; i<m; i++) printf ("%d\t", A[i]);}    void Downsort (int a[], int m)//in descending order with bubble sort {int i,j;    int temp;    int flag=0;                For (i=0, i<m; i++) {for (j=0;j<m-1-i; J + +) {if (a[j]<a[j+1]) {                TEMP=A[J];                A[J]=A[J+1];           A[j+1]=temp;     flag=1; }        }    }}
    • Write a program that counts how many lines of code your C language has written.

I'm sorry I can't write this program. I also found a similar program on the Internet, but this part of the file operation is my weak point. After referencing someone else's code, I think the program's general thinking should be

graph LRA[遍历一个目录下所有.c的文件]-->B[分别统计行数]B-->C[分别相加]
    • Do you know what a breakpoint is? Give an example of your own debug program.

breakpoints, one of the debugger's features, allows the program to break where it is needed, thus facilitating its analysis.

Breakpoints can also be 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.

The breakpoint pattern can be considered a timeout. All elements, such as functions, variables, and objects, remain in memory, but their movements and activities are suspended. In break mode, you can check their location and status to see if there are conflicts or bugs. You can adjust the program in break mode. For example, you can change the value of a variable. You can move the execution point, which changes the next statement that will be executed after the recovery is performed. In C + +, C #, and Visual Basic, you can even make changes to the code itself in break mode (using a powerful feature called Edit and Continue).
--Breakpoint-Baidu Encyclopedia

Personal understanding, breakpoints are in the process of debugging the program, the program runs to the place can be paused, all data retention. It then examines the error of the program by analyzing the data changes by line.

There are many examples of breakpoint debugging, such as the last semester of the Secret number experiment: to find a number of generators , I have used a breakpoint debugging test program.

    • Refer to how to quickly read a book, quickly read the cloud class has PPT, each chapter raises a question
    1. How do I understand classes?
    2. Identifiers consist of letters, underscores, dollar signs, and numbers

Why is there such a code in the example that appears in Chinese?

byte x= -12,  tom=28,  漂亮=98
    1. What is the "boolean data", which differs from the 1 and 0 judgments of a real number?
    2. Is there an order of execution between classes? How do I do this if I need to do it successively?
    3. What is "subclass and parent class in/not in a package"? What is "package"?
    4. Is it possible to associate an interface with a "formal parameter" in a C-language function?
    5. C, breakpoint debugging is to set breakpoints, and then start from the breakpoint line by row debugging, Java is the assertion similar?
    6. is the specific class in a utility class The one that Java has set up for a particular object?
    7. What is a GUI?
    8. Where is the stream used? Can't I manipulate files directly?
    9. What is a database?
    10. What is the difference between the wait () method and sleep (int millsecond)?
    11. What can Java network programming do in addition to transmitting data, remote calls, and other functions?
    12. Can Java implement a variety of graphics editing capabilities?
    • 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"? Compared to the C language learning, I hope that Java I can learn more in-depth, not only to stay in the shallow knowledge. For improving the program design ability and training computational thinking, in addition to adhere to practice and timely feedback, I think should gradually contact some more difficult than their own level of the program, easy-to-digest, can not "quit", only stay in the learning comfort zone.

20165218 Learning Basics and C-language basic survey

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.