20165310 Learning Basics and C-language basic survey

Source: Internet
Author: User

Learning Basic and C-language basic survey to do middle school experience

After reading to do the middle school, understand the teacher about Wubi practice, weight loss, ping-pong and recite words experience, can't help but think oneself learn guzheng experience.

    • A successful experience
      • Interest
        I actually learned a period of time when I was a guzheng, but then it was because of my parents ' request that I did not like it and then ended it. Until after a few years of his own interest in the Guzheng, the initiative to re-learn the guzheng, has persisted to the end.
      • Focus
        Ashamed to say, I practice piano is never fixed-time quantitative, but according to the mood and concentration, for me, absent-minded practice two hours of efficiency is not focused on practice half an hour high. When the state is not good, I will give up practice, the state of good when the continuous practice for a few hours do not feel tired, the final effect is good.
      • Insist
        Learning process also encountered many difficulties, such as the middle stop of the fault, such as the conflict with the school, but did not want to give up, gradually adhere to down, although the distance from school, carrying inconvenience and other reasons, is still unfamiliar, but in the whole learning process, never interrupted.
    • Common Place
      • Perseverance
        No matter what kind of skill you learn, it is your insistence. Learning speed varies from person to person, there is fast and slow, but as long as adhere to, regardless of speed can achieve the goal.
      • Practice carefully
        From the teacher's blog to contact their own experience, it is not difficult to see, all the learning process to pay efforts, no overnight things, need to practice carefully, to have a harvest.

        Basic survey of C language

        The data structure for the sophomore curriculum, some problems are not well understood, through the network to form their own understanding of the query, if there is a misunderstanding hope the teacher can point out.

    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?
    • Listen to the class and practice the class. Query the network, can not solve the questions.
    • Heavy in understanding, although the grammar is important, but can be learned immediately, more important is the design of the algorithm, programming is just the process of implementing the algorithm, can be implemented in many ways, exercise their own thinking is the key.
    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?
    • There should be no less than 4000 lines in any particular calculation.
    • The feeling for complex programs is not yet proficient in writing, understanding but not deep enough.
    • First, the quantitative: Basic short Code practice, learning to understand, and then qualitative change: call knowledge, flexible use, complete a deeper level of understanding learning.
    1. Learned the C language, you divide the array pointer, pointer array, function pointer, pointer function these concepts?
    • Array pointers: essentially pointers, pointing to array addresses
      • eg

        int a[5],*p;p=a;
    • Array of pointers: an array of essentially arrays, which are made up of pointers.
      • eg
int (*p)[3];
    • function pointers: essentially pointers, pointing to functions
      • eg
int function(int x,int y);//自定义某函数,具体不写int main(){    int a=3,b=4,s;    int (*p)(int ,int);    p=function;    s=(*p)(a,b);    return 0;}
    • Pointer function: Essentially a function, a function that returns a pointer to a value.
      • eg
int *(pr(int (*p)[2] ,int a ));{    int *str;    str=*p==a?*p:*(p+1);    return str;}
    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?
    • File and stream differences and linkages: A file is a collection of information, a real device, and a stream is an abstract concept that connects programs with files, devices, imported or exported devices.
    • Text files and binaries: text files are sequences of characters that do not correspond to the sequence of characters in the peripheral, need to be converted, and binary files are byte sequences that do not need to be converted to correspond directly.
    • Programmatic operation of two kinds of files: The C language specifies the corresponding function operation:
      • Text file functions: "R", "W", "A", "r+", "w+", "A +"
      • Binary file functions: "RB", "WB", "AB", "rb+", "wb+", "ab+"
    1. Have you learned C language, do you know what is process-oriented programming? What is the way it solves the problem?
    • Process-oriented programming is a concrete step in the process of analyzing and solving the problem, and the program is programmed according to the specific steps, and each function is executed sequentially.
    • Problem-solving methods: According to the analysis of the problem, according to the order of execution of each step, according to the steps of correspondence programming.
    1. What is a module in C language? Have you ever written a program for multiple source files?
    • In C language, modules can be approximated as functions.
    • Not 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?
    • "High cohesion, low coupling" understanding: high cohesion refers to the module as unique as possible to complete a single sub-function; Low coupling means that the modules and modules are as independent as possible, and the interface between modules and modules is as small and simple as possible.
    • In the design of the program, we should learn to module into a single, relatively independent module, and then flexible call, programming.
    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.
    • Array replication:
#include <stdio.h>#include <stdlib.h>#include <string.h>int main(){   int a[100],b[100],i,n;   printf("Input n=:");   scanf("%d",&n);   for(i=0;i<n;i++)   {       scanf("%d",&a[i]);   }   memcpy(b,a,sizeof(int)*n);    return 0;}
    • Array sorting:
      From big to small:

      #include <stdio.h>int main(){   int a[100],i,j,n,temp;   printf("Input n=:");   scanf("%d",&n);   for(i=0;i<n;i++)   {   scanf("%d",&a[i]);   }  for(i=0;i<n-1;i++)  {  for(j=i+1;j<n;j++)  {      if(a[i]<a[j])      {          temp=a[i];          a[i]=a[j];          a[j]=temp;      }  }  }return 0;}

      From small to large:

#include <stdio.h>int main(){   int a[100],i,j,n,temp;   printf("Input n=:");   scanf("%d",&n);   for(i=0;i<n;i++)   {       scanf("%d",&a[i]);   }  for(i=0;i<n-1;i++)  {      for(j=i+1;j<n;j++)      {          if(a[i]>a[j])          {              temp=a[i];              a[i]=a[j];              a[j]=temp;          }      }  }    return 0;}
    • Find out if the number 5 is present:

      Assuming that the above procedure has been ordered from small to large, the following procedure directly to find the binary method

#include <stdio.h>int judge(int a[],int n){    int high=n-1,low=0,mid;    while(low<=high)    {     mid=(high-low)/2+low;     if(a[mid]==5)     {         return 1;     }     else if(a[mid]>5)     {         high=mid-1;     }     else     {         low=mid+1;     }     return -1;    }}int main(){   int a[100],n,ans;//数组a已输入并从小到大排序,n为a的长度     //具体程序见上面的“数组排序”    ans=judge(a,n);    if(ans==1)    {        printf("yes");    }    else    {        printf("no");    }    return 0;}
    1. Write a program that counts how many lines of code your C language has written.
    • Idea: Put all the. c files in a folder, scan the folder directory, and then read the. c file according to the directory, not the comment line is calculated as a line (according to the personal programming habit, the comment line isUnified to//start, you can modify the program as '/'/')
    • Insufficient:
      • For the Opendir,readdir function is not very understanding, a lot of code is based on the example of mechanically, their own independent can not be used flexibly, can not use the Dir and other functions from all the suffix file to read. c files
      • For file operations, the file function understanding is not deep
#include <stdio.h> #include <dirent.h> #include <stdbool.h>int main (int argc, char const *argv[]) {FILE    *pt;    Char *pt1,ch,buf[10000];    DIR *dirptr=null;    int count=0;    struct Dirent *entry;        if ((Dirptr = Opendir ("Test.dir")) ==null)//operation failed {printf ("Opendir failed!");    return 1; } else {while (Entry=readdir (dirptr)) {if ((Pt=fopen (Entry, d_name, "R")) ==null)//open operation not                     Success {printf ("The file can not be opened.\n");                    Exit (0);//End Program execution} else {if (feof (!pt)) {                    CH=FSCANF (PT, "%1s", ch);                        if (ch== ' \ n ')//scan to newline character {pt1 = Mystrstr (PT, "//");//Location of comment                    if (pt1! = PT)//is not an entire line of comments {count++;//code multiple line} } fgets (buf,10000,PT);                    if (buf[0]== ')//delete empty line number {count--;        }}}} Closedir (DIRPTR);    printf ("Number of rows is%d\n", count); } return 0;}
    1. Do you know what a breakpoint is? Give an example of your own debug program.
    • After setting a breakpoint, the program runs to the breakpoint and stops automatically, allowing us to step through the debugging.
    • In many programming cases, a breakpoint is set to be debugged with no syntax errors and cannot be run.
Quick reading and questioning

After reading how to read a book quickly, because there is no material, the PPT has been read.

    • Chapter One: How to configure Java in Linux,macos and other environments? Python,java,c language can you share an environment?
    • Chapter Two: In the input object call see Eader.++has++nextdouble (), in the format of the call in PPT, does not contain the format of has, and to System.in.read (); and Scanner reader=new Scanner (system.in), such as the use of specific Scanner there is a certain confusion.
    • Chapter III: What is the practical meaning of the instanceof operator? For (Declare loop variable: The name of the array) in use, do not need to know the number of team leader degree?
    • The fourth chapter: the two places in the reference and package are not quite understood.
    • The fifth chapter: when to apply to subclasses?
    • The sixth chapter: what is the difference between public and static,final interface variables?
    • The seventh chapter: why does the Try-catch statement solve the exception rather than fundamentally change the cause of the exception statement error? Can the Try-catch statement resolve all exceptions?
    • The eighth chapter: what is the difference between reference and entity?
    • The Nineth chapter: not very understanding the difference between different processing events and applications.
    • Tenth: How to restrict the suffix name of the read file, such as Read only. txt files ignore other files?
    • The 11th chapter: How to use MySQL database and SQL Server database and Derby database respectively, can you build a database with Java?
    • The 12th chapter: Java is multi-threading, but why does the PPT say "The JVM will know that there is a new thread waiting to be switched," is queued rather than simultaneous?
    • The 13th chapter: PPT explains the receiving and sending of UDP-based packets, then how to receive and send packets based on TCP?
    • The 14th chapter: apart from the clock formula there are other special formulas?
    • The 15th chapter: what is the specific data structure of the hash table, and what is the difference between the list and the chain?
Java Learning
    • What specific goals do you have for the study of Java programming in comparison to the study of C language?
      • Learning Goal: The ability to use Java more skillfully, to complete some of the slightly complex difficult programming.
    • How to improve the program design ability and develop the computational thinking through deliberate training?
      • Training methods: More practice, more questions, more thinking, and then return to practice.
    • How do you achieve your goals through "doing middle school"?
      • Through practice has mastered the knowledge, to explore their own doubts and loopholes, and then to think and practice, to make up the gaps in knowledge, and finally return to practice.

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