What is the difference between L data i and L data i, thank you

Updated on Car 2024-05-01
14 answers
  1. Anonymous users2024-02-08

    The former l is a struct variable, and data[i] is one of the structs.

    This is said to point to one in the structure.

  2. Anonymous users2024-02-07

    The usage is defined in the front, and the usage is directly invoked in the back.

  3. Anonymous users2024-02-06

    C language problem, first of all, children should know that the linear table in the data structure is divided into two types: sequential and chain, and ".".For access to attributes of sequential tables, and —> for access to attributes in linked lists. For example, based on the representation you gave, for the sake of simplicity, let's first think of data[i] as a variable data rather than an array.

    Let's define a sequential table:

    typedef struct{

    int *elem;

    int data;

    sqlist;

    At this point, constructing a linear table l (statement: sqlist &l) to access its elements should be; Accordingly, we define a linked list:

    typedef struct lnode{

    int data;

    struct lnode *next;

    lnode,*linklist;

    In this case, you construct a linked list l (statement: linklist &l or lnode *l), which should be accessed by l->data.

    As for data[i], either the variable is defined as an array, or it should be defined as an array of structs, defined in the form struct data{

    int a;

    data[n];

    Note that the value of n should be well defined, and the definition of the sequential table can also be used as the definition of the linked list, which is to put it bluntly, it is a level by level to access. Then you add data data to the above sequential and linked lists; Then it can be accessed in a formal way, and the truth is formed.

  4. Anonymous users2024-02-05

    l should be a variable of the structure...

    data is defined in a struct.

    The ** of the structure is posted, and I analyze that your place should be a student linked list.

  5. Anonymous users2024-02-04

    You're going to tell me what type of L->Data[i] is? to determine how to use printf

    1. If L->Data[i] is of type int.

    printf("%d",l->data[i]);

    2. If l->data[i] is of float type printf("%f",l->data[i]);

    3. If L->Data[i] is char type printf("%c",l->data[i]);

    4. If L->Data[i] is a string type printf("%s",l->data[i]);

  6. Anonymous users2024-02-03

    Insert the latest input into the first position, and move the old data backwards one position in turn.

  7. Anonymous users2024-02-02

    for (j = l->length - 1; j >= i; j--)

    l->data[j + 1] = l->data[j];

    This sentence can be understood like this:

    len = l->lenth;

    for(j = len - 1; j >= i;j--) for loop.

    j from largest to smallest, that is, from the last digit of the array to the first digit.

  8. Anonymous users2024-02-01

    lt may be a macro definition, and the latter is no different from the latter, and if the logical expression is too long, lt will look crisper.

    It must be able to compare the size.

    Not necessarily, i.e. < may not be compilable because the comparison between the two struct sizes is not defined.

  9. Anonymous users2024-01-31

    These two are used for different situations.

    1.*l is used on the premise that l is a pointer, i.e. l is defined as follows:

    int a = 3;

    int * l = &a;

    Then *l represents the value of the variable that l points to, so the value of *l is 32&l

    As you can see in 1, we can use &a to get the address of variable a, which can be assigned to a pointer.

    Remember, it's the address of the variable, and if you output &l, you'll see a string of numbers representing the value of the address.

    Also, &l only makes sense for variables that aren't of the pointer type, which is not the right way to use a pointer that way.

  10. Anonymous users2024-01-30

    Of course, there is a difference: i is in the capital form of i. L is lIt's just one long and one short.

  11. Anonymous users2024-01-29

    Probably trying to insert a value at l-data[i-1] to make room for it, so move the following elements back one bit.

    The first line is the schematic diagram before the execution, and the second row is the schematic diagram after the execution, and 1234 is the hypothetical value in the figure.

  12. Anonymous users2024-01-28

    If you add another sentence **: l->data[i-1]=value; (the value you want to insert) implements the value"value"Inserted into the i-th node (subscripted I-1).

    The detailed explanation is: if there are 5 numbers a[6]=; Then it is inserted into the second node (subscript 1), which is the middle of the number 0 and the number 1, a[5]=a[4];

    a[4]=a[3];

    a[3]=a[2];

    a[2]=a[1];

    a[1]=;

    Finally, a[6]=;

    I can only help here.,Let's experience it yourself.。。

  13. Anonymous users2024-01-27

    l(i) refers to the number of l and is a function, e.g. l(1) refers to the first number of the l matrix.

    l{i} is a matrix called l.

    That's how I understand it.

  14. Anonymous users2024-01-26

    Curly braces represent a cell unit, if l is defined as a zhicell, you can use parentheses, dao, or inner, but if you define it in a format that accommodates other types, you can't use curly braces.

    Regardless of the type of matrix, parentheses return a value for the corresponding type. For example:

    a = cell(2,3);

    a = [2,3;5,6];

    then a = 2x2 double].

    b = a(1,2);

    then b = [2x2 double].

    It is a 1*1 cell type with a value of a(1,2), i.e. b = 2 3

    c = a;

    then c = [2, 3; 5, 6]

    He is the specific value of column 2 of row 1 of a.

    In addition, the assignment of a cell type must be in the correct format.

    a(1,1) = ;

    or a = ones(5,6);

    or a = ;

    The first assignment, the first cell of a will be a row vector;

    The second assignment, the first cell of a will be a matrix of 5 to 6;

    The third assignment, the first cell of a will be a 1 2 cell.

Related questions
2 answers2024-05-01

Apple The New iPad (16GB WiFi Version) Screen Size: Inches Capacitive Touch. >>>More

5 answers2024-05-01

Obviously, in Chinese grammar, a believing, adjective is the use of the verb. A trust, the part of speech can be used as a noun or a verb, and it also contains the usage of adjectives.

3 answers2024-05-01

1. The focus is different.

The A-level course pays more attention to the students' grades, while the IB course not only attaches importance to the grades, but also attaches importance to the cultivation of students' comprehensive quality. >>>More

5 answers2024-05-01

IMAX film refers to the shooting of films, and only IMAX films are shot with a 70mm camera. >>>More

20 answers2024-05-01

Chinese food and Western food are the main ways of eating in our lives, and they are very different due to the differences in food culture in different countries. >>>More