20165334 Learning Basics and C language learning experience

Source: Internet
Author: User

Learning basic and C language learning experience one, skills learning

?? I think in the boys, I should be good at cooking. I was in grade four began to learn to cook, from the beginning of learning to cook rice, to later steamed buns, to the last stir-fried home cooking really has a sense of accomplishment. First of all, I think it is important to do anything, because as a child like food, so especially like to do something for others to eat, second, I think other people's encouragement is very important, it will be your motivation to continue. Because the father to my cooking encouragement, cook dinner from the beginning of the tomato egg noodles to the later three dishes a soup, although the cooking time more and more, but their sense of accomplishment is getting stronger. Watching others eat what they do, they feel very happy. So this is the same as Lou teacher said in the following paragraph.

I think it is a good way to arouse students ' interest, curiosity and curiosity by giving students concrete, practical and immediate knowledge of the cause and effect of teaching materials and exercises. That's how I learned programming and software development. So I am very fond of the method of "learning to learn". The software engineering has the theory part, has the engineering part; Having the part of art, having a handicraft part; Before students reach the stage of theory/art, a lot of practice is necessary.

--Quoting from "excellent teaching methods---Coaching and doing high school"

?? Therefore, in the future Java Learning to develop their interest in Java programming, through the simple problems in reality to achieve programming, improve the sense of accomplishment. For example, before probability theory has many problems of calculating variance, it realizes the function of calculating variance by using C language programming. Again, adhere to the understanding of the basis of the daily knock some code, the weekly to the code of their own knock summary, optimization, to improve the programming ability.

Second, C language learning

1. How to learn C language

?? In most cases, it is through their own reading comprehension (not by asking teachers, students understand), through imitation examples, operating system to practice. Through a semester of study, feel that they do in independent thinking can also, but practice too little, did not stick down. A semester down probably wrote more than 3,000 code, but only to brush points, not understanding thoroughly, a lot of is not done independently. I think the efficiency of learning is very important, the time you spend is not equal to the time you put in, the time to invest in the quantitative changes will lead to qualitative change. Therefore, the key to learning is to improve efficiency, improve the effective investment time, so that the harvest can be greater than the input.

2. Some knowledge points of C language

Array Pointers an array pointer, which is a pointer to the array name, which is the address of the first element of the array. That is, a pointer to an array. Example: Int (*p) [ten]; P is a pointer to an array, also known as an array pointer. The essence is the pointer
Array of pointers An array of pointers is an array of array elements as pointers (for example, int *p[3], which defines the p[0],p[1],p[2] three pointers), which is essentially a group.
function pointers A function pointer is a pointer variable that points to a function. Thus the function pointer itself should first be a pointer variable, except that the pointer variable points to the function. Int (*f) (int x)/Declare a function pointer/
Pointer functions First it is a function, except that the return value of this function is an address value. The function return value must be accepted with a pointer variable of the same type. int *PF (int a); /Declare a pointer function
    • Differences and links between files and streams

?? Flow : The flow of data. (Data flow is always associated with equipment or external media);

?? files : Devices and media related to data flow are collectively referred to as files.

?? in fact, the C language stream is equivalent to the file pointer

    • Distinguishing and manipulating text files and binaries

?? differences : Text files are character -encoded files (common encodings are ASCLL); binary encoding is a value -encoded file; it can be seen that text files are essentially fixed-length encodings and binary files can be seen as variable-length encodings

?? action : In Notepad, for example, it first reads the binary bitstream corresponding to the file physically, and then interprets the stream in the way that you choose to decode it, and then displays the interpretation results. For example, for file stream "01000000010000010100001001000011" the first 8 bit "01000000" is decoded by ASCLL code, corresponding to the character "A", the same as the other three 8 bits can be decoded as "BCD", that is, this file stream can be interpreted as " ABCD "and then show up on Notepad.

    • Process-oriented programming

?? 1, Understanding : Process-oriented is concrete, process-based. Solving a problem requires a step-by-step analysis of how it needs to be, and then how it needs to be implemented step-by-step.

?? 1, solve the problem of the method : The process is a basic approach, it is to consider the actual implementation, in general, the process is the top down gradually refinement, its most important is the modular way of thinking.

    • module, source file.

?? 1, the understanding of the module: the realization of a function of the program as a whole to deal with the level of independent, identifiable program instructions.

?? 2, about the source file : Only in the process of the string to understand some of the source files. For example, "character length", "Copy of String", "string connection, Comparison" and so on.

    • Some C language programs
#include <stdio.h> #define N 40void ADG (int a[],int n);      Sort in ascending order void DDG (int a[],int n);//descending order int main () {int i,n;      int a[n],b[n];      int flag;      int t=0;      printf ("Please enter A of number:\n");      scanf ("%d", &n);      printf ("Please enter a:\n");          for (i=0;i<n;i++) {scanf ("%d", &a[i]);      b[i]=a[i];//Copy array A to the array B printf ("%d", b[i]);      } printf ("\ n");      printf ("Select the sort of array a, enter 1 in ascending order, enter 0\n in descending form");      scanf ("%d", &flag);      if (flag) {ADG (a,n);      for (i=0;i<n;i++) {printf ("%d", a[i]);      }} else {DDG (a,n);       for (i=0;i<n;i++) {printf ("%d", a[i]);      }} printf ("\ n");      for (i=0;i<n;i++) {if (a[i]==5) t=1;      } if (t==1) printf ("5" \ n "exists in array a);  else printf ("There is no" 5 "\ n" in array a);       } void ADG (int a[],int n) {int i,j,k,temp;           for (i=0;i<n-1;i++) {k=i;      for (j=i+1;j<n;j++) {if (A[j]>a[i]) {             K=j;               }} if (k! = i) {temp=a[k];               A[k]=a[i];           A[i]=temp;       }}} void DDG (int a[],int n) {int i,j,k,temp;           for (i=0;i<n-1;i++) {k=i;               for (j=i+1;j<n;j++) {if (A[j]<a[i]) {k=j;               }} if (k! = i) {temp=a[k];               A[k]=a[i];           A[i]=temp; }       }   }
    • Count the total number of lines of code written by the program
      This self won't write, but find the reference answer in detail see the following link
      Netizens provide statistics C language altogether wrote how many lines

    • Breakpoint : Refers to the program during the debugging process, let the program run to a location stop, this is a breakpoint.

?? take the above sort procedure as an example

    • About Java Learning

?? Make full use of blog and other network resources for self-conscious learning, adhere to every day to knock some code, a week on the knowledge of the use of blog writing essays form to summarize, through the teacher and the same with the students to discuss communication and constantly improve the programming ability.

20165334 Learning Basics and C language learning experience

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.