How to use C language to add, delete, modify, check the details

Updated on technology 2024-03-12
9 answers
  1. Anonymous users2024-02-06

    #include

    #include

    typedef struct node

    node;Linked list output.

    void output(node *head)

    printf("");

    Linked list is created.

    node* creat()

    head->pstnext = null;

    p = head;

    while(cycle)

    s->ndate = date;

    p->pstnext = s;

    p = s;

    elsep->pstnext = null;

    return(head);

    Linked lists are searched by value.

    void research_date(node *head, int date)

    if(null == p)

    else if(date == p->ndate)

    return;

    Search by serial number.

    void research_number(node *head, int num)

    if(p == null)

    else if(i == 0)

    else if(i == num)

    Inserts a new node before specifying an element.

    void insert_1(node *head, int i, int newdate)

    if(null == pre ||j > i-1)

    elsenew->ndate = newdate;

    new->pstnext = pre->pstnext;

    pre->pstnext = new;}}

    Inserts a new node after the specified element.

    void insert_2(node *head, int i, int newdate)

    if(j == i)

    new->ndate = newdate;

    new->pstnext = pre->pstnext;

    pre->pstnext = new;

    else deletes the specified node.

    void delete_1(node *head, int i3)

    if(null == p)

    elsevoid main()

  2. Anonymous users2024-02-05

    You have to find the engine in C that embeds SQL (it should actually be a library).

    Then you can use SQL, and what to do next, it should be relatively simple.

  3. Anonymous users2024-02-04

    This line**: array=(structure record*) malloc(sizeof(structure record)*num); is the memory structure record type of the application, which you define as int*, so interpret the *array into a structure record* array, and put the other definition of the outer num and I don't record the definition together, otherwise, the same type and record, are independently defined as: integer number, scanf function ("c", with array [i] coefficient); Reform to the scanf function (in "f", the array is determined by the [i] coefficient).

  4. Anonymous users2024-02-03

    Your question is very vague, please make the form clearer.

  5. Anonymous users2024-02-02

    Required:

    Basic syntax, definition, assignment, input and output, loop, judgment, basic operation file operations: addition, deletion and modification.

    Data structures: pointers, linked lists, structs.

    Sorting: At least bubbling up.

    Basic structure: 1) Input part, input data, logical judgment, file processing (scanf, gets, if-else, file) 2) part, file processing output data + input data.

    scanf,gets,printf,file)3) query part, file processing sorting processing + logical judgment + input data output data (..

    4) Optionally, the bottom layer of the database is a set of functions that provide interface functions for adding, deleting, modifying, and querying.

  6. Anonymous users2024-02-01

    It depends on how your data is stored!

  7. Anonymous users2024-01-31

    e.g. struct student s[10];

    If you want to delete s[5], just move the next element forward to overwrite the previous element, and then the last element is not used!

  8. Anonymous users2024-01-30

    If you want to delete a member of a struct, you can only delete it where it was declared.

  9. Anonymous users2024-01-29

    You can follow the steps below to define a two-dimensional array and output:

    1 Define a two-dimensional pointer.

    2 Determine the number of array dimensions, i.e., the number of rows and columns.

    3. Apply for several 1D pointer size spaces in the row, and assign values to 2D pointers.

    4 For each one-dimensional pointer, apply the space of several elements in the column and assign a value to the corresponding one-dimensional pointer.

    5 Enter or assign data.

    6 Using a double cycle, the range of storage cells and output them one by one.

    7 Free up memory on the 1D pointer one by one.

    8 Free up memory on the 2D pointer.

    Take an integer two-dimensional array as an example:

    In the following **, the number of rows m and the number of columns n of the two-dimensional array are first entered, and then m*n integer data is entered into the dynamic two-dimensional array. Finally, the element values of all 2D arrays are output.

Related questions
7 answers2024-03-12

It's called the [batch] program, in fact, don't think that the program you mentioned above to deal with garbage is really powerful, it's amazing, when you have learned DOS, that program can be said to be a very simple thing; >>>More

5 answers2024-03-12

int main()

int i,j,k; >>>More

10 answers2024-03-12

In C, you can't actually get carriage returns with any method (regular library functions). Because the console is after you enter a line and click enter, send the characters other than the enter to the program input cache together, you can only use workarounds, such as getting a line, a character or a number at a time, and setting multiple inputs, then after entering, it will inevitably go into the next input or ** block. >>>More

4 answers2024-03-12

Humorously introduce yourself in short sentences that are as follows:1. Every time I walk alone at night, I'm so scared, it's so dark, I'm so handsome, I'm afraid that others won't see it. >>>More

8 answers2024-03-12

I want to ask, have you written it now?