C Language Blog Job--character array

Source: Internet
Author: User
Tags strcmp

First, the PTA laboratory work problem 1:7-3 find the longest string 1. PTA Submission List

2. Design ideas (pseudo-code or flowchart) 3. Code

4. Problems encountered in debugging process and PTA Submission List situation description.
    • So that's what I wrote.

      Because there is only one point pair, and then in the comparison of the length of the string is a bit messy, so I asked the students to finish this problem, found me very troublesome, I defined a two-dimensional array to put multiple strings, then calculate the length, then the length of the comparison, and then output row subscript. And the definition of one-dimensional students can be, after the change appears

      Directly on the answer is wrong, later check out is b[] defined length is not enough, change to the same length as the first array of 80 is right

      Topic 2:7-8 bubble sort of string 1. PTA Submission List

      2. Design ideas (pseudo-code or flowchart)

3. Code

4. Problems encountered in debugging process and PTA Submission List situation description.

    • At first I didn't know how to exchange two lines of string, define an integer number variable int t, let t=str[j]; STR[J]=STR[J+1]; str[j+1]=t; then the integer type and the character array cannot be assigned, and then I define a c[11] array for the interchange, and then prompt for an invalid interchange, I went to the Internet to check how to let the two lines of string exchange, changed to this appearance, so that after running out is right, But PTA has been only a point right, and finally I changed the conditions of judgment on the right. This problem has learned the use of strcmp and strcpy, strcmp is convenient for comparing the length of strings.

      Topic 3:7-12 IP Address conversion 1. PTA Submission List

      2. Design ideas (pseudo-code or flowchart)

3. Code

4. Problems encountered in debugging process and PTA Submission List situation description. Second, this week's topic set PTA Final ranking. PTA Rankings

Third, peer code peer review 1. Peer evaluation of the name of the students 2. My Code, peer-review student code (here The core code is good, not necessarily all the code, the figure indicates whose code.) 3. Where do I differ from my classmates ' code? What are the advantages? What style of code do you prefer? If the classmate code is wrong, please help to point out where the problem. Iv. Study Summary of the Week 1. What did you learn? 1.1 How pointer variables are defined (design code can be rendered with markdown code symbols)?
    • Definition: Data type * pointer name

      1.2 pointer addition operation in which case, can the 2 pointer variables be added to each other?
    • Two pointers to arrays are * (p+i) =a[i];
    • Two pointer variables cannot be added

      1.3 The pointer does not assign the initial value, direct use, what happens, please use DEVC verification, and show?
    • 1.4 Lessons about separating the integer and fractional parts of a floating-point number, use DEVC to verify the implementation, and show it in this map, and also indicate which is the pointer variable to do the function parameter, and how the function argument should be represented. What is the use of pointer variables for function parameters?
    • 1.5 Please change the bubble sort function of the textbook into a pointer variable to do the formal parameter format, and write the code at the bottom, pay attention to the markdown syntax rendering.
    • 1.6 How to define a pointer variable to an array, and how to use a pointer variable to represent an array element?
    • Point to array int a[10]; *p=a;
    • Point to array element * (P+i) =a[i]

      1.7 How do I define a character pointer to a string? Where is the initial position after the pointer points to the string?
    • Char p; char str[10] = "AFJKFDHSJK"; p = str or char str[10] = "AFJKFDHSJK", P=atr;
    • Pointer p points to the first address of the string str, *p=str[0]

      1.8 Use a character pointer to manipulate strings, such as design functions, to implement string joins, and show the code in this map. What are the advantages of the method that indicates the pointer represents a character?
    • 2. What is your content this week? 2.1 Class allocation and how to revise the wrong questions.
2.2 Others not? What are you going to do? 3. Array on-Machine exam summary 3.1 The wrong question, please list? 3.2 Wrong question How to revise, why wrong?

C Language Blog Job--character array

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.