Results 1 to 5 of 5

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    a.k.a. Kal KaloyanP's Avatar
    Join Date: Dec:2005
    Location: UK
    Posts: 3,750

    ? C, linked lists, malloc, typedef, etc...

    ! , , , .. dynamic memory allocation, - . , , .

    :
    Code:
    typedef struct list_item_struct 
    {
        char word[32];
        int freq;
        struct list_item_struct * next;
    } list_item;
    , list_item_struct list_item. list_item - list_item_struct? list_item *next ? , list_item , list_item_struct ?



    .. Inception...
    D80; 50/1.8D; Tamron 70-300; 18-55 VR;

  2. #2
    Exhumator's Avatar
    Join Date: Jan:2005
    Location: Sofia
    Posts: 14,687
    , . .
    | Aorus X570 Master | Ryzen 9 5900X | Hellhound 7900XT | G.SKILL 32GB DDR4 3800 CL16 | Enermax Galaxy 1000W | SSD Corsair MP510 960GB & WD-RE3 2 x 1TB RAID0 | Pioneer BDR-209EBK | Creative X-Fi Titanium Fatal1ty & GigaWorks S750 | ViewSonic VX3276-2K-MHD |

  3. #3
    a.k.a. Kal KaloyanP's Avatar
    Join Date: Dec:2005
    Location: UK
    Posts: 3,750
    Quote Originally Posted by Exhumator View Post
    , .
    - ? :

    list_item_struct list_item? , , ? ?

    , , typedef :

    Code:
    typedef < > <   >
    :

    Code:
    typedef struct
    	{
    		int a[10];
    		char b[32];
    	} mystructure;
    mystructure .

    .. :

    typedef < list_item_struct, > < , list_item>

    , :

    Code:
    struct list_item_struct 
    {
        char word[32];
        int freq;
        struct list_item_struct * next;
    };
    
    typedef struct list_item_struct list_item;
    ?

    .
    ...
    D80; 50/1.8D; Tamron 70-300; 18-55 VR;

  4. #4
    ɐ-əpoɔᴉu⋂ ɐ ə anrieff's Avatar
    Join Date: Apr:2004
    Location: Sofia
    Posts: 8,448
    , C C++.

    C++, , :

    Code:
    struct Point {
        double x, y;
    };
    :

    Code:
    Point p = {2.5, 3};
    C, , , , :

    Code:
    struct Point p = {2.5, 3};
    , , , "struct T < >".
    - , struct .

    , ( C):

    Code:
    struct _Point {
        double x, y;
    };
    typedef struct _Point Point;
    "struct _Point" "Point" .

    , , .
    , , , Point - "struct _Point" , :

    Code:
    struct _Point {
        double x, y;
        struct _Point* next; // (*)
    };
    typedef struct _Point Point;
    , "Point" (*). , .
    , . .
    "640K ught to be enough for anybody" - Bill Gates, 1981
    ::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel

  5. #5
    a.k.a. Kal KaloyanP's Avatar
    Join Date: Dec:2005
    Location: UK
    Posts: 3,750
    Quote Originally Posted by anrieff View Post
    , C C++.

    C++, , :


    Code:
    struct Point {
        double x, y;
    };

    :


    Code:
    Point p = {2.5, 3};

    C, , , , :


    Code:
    struct Point p = {2.5, 3};

    , , , "struct T < >".
    - , struct .


    , ( C):


    Code:
    struct _Point {
        double x, y;
    };
    typedef struct _Point Point;

    "struct _Point" "Point" .


    , , .
    , , , Point - "struct _Point" , :


    Code:
    struct _Point {
        double x, y;
        struct _Point* next; // (*)
    };
    typedef struct _Point Point;

    , "Point" (*). , .
    /Hidden:


    , -
    D80; 50/1.8D; Tamron 70-300; 18-55 VR;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |