C + + struct pointers and doubly linked lists

Source: Internet
Author: User

? Structure pointers-dynamically allocating memory for structure pointers? Structure in a structure? A doubly linked list? structure pointerstructMyTime {//Char name[256];         intHour//when         intMin//points         intSec//seconds     }; structStu_data {Charname[ the];//Student Name         structMyTime Stutime;//sign -in time     }  ; structStu_data *stu;//int *pi;? Dynamically allocating memory stu for structures=malloc(sizeof(structStu_data));//256+12=268structure in the structurestructStu_data {Charname[ the];//Student Name         structMyTime {//Char name[256];             intHour//when             intMin//points             intSec//seconds} stutime;//sign -in time     }  ; structMyTime T2; structStu_data *Stu;? The doubly linked list is a non-sequential, non-sequential storage structure on a physical storage unit, and the logical order of the data elements is implemented by the order of the pointers in the linked list. A linked list consists of a series of nodes (each element in the list is called a node) that can be dynamically generated at run time. Each node consists of two parts: one is the data field that stores the data element, and the other is the pointer field that stores the next node address.      The list is easier to insert and delete than the linear table order structure. structMyTime {//Char name[256];         intHour//when         intMin//points         intSec//seconds     }; structStu_data {Charname[ the];//Student Name         structMyTime Stutime;//sign -in time         structStu_data* Front;//point to a previous node         structStu_data* back;//point to the next node     }  ; Stu=malloc(sizeof(structStu_data));//256+12=268 1Front backname Stutime ... Additional Data NULL22name Stutime ... Other data1    33name Stutime ... Other data2    44name Stutime ... Other data3xxxxname Stutime ... Other data4    0x00411180x0041118name Stutime ... Other data xx NULL

C + + struct pointers and doubly linked lists

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.