Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. krunode

krunode

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    youbo
    wrote on last edited by
    #1

    typedef struct node { char name[20]; struct node *link; }stud; stud * creat(int n) who can explain it for me?the more amply the better

    L D N J 4 Replies Last reply
    0
    • Y youbo

      typedef struct node { char name[20]; struct node *link; }stud; stud * creat(int n) who can explain it for me?the more amply the better

      L Offline
      L Offline
      Lord Kixdemp
      wrote on last edited by
      #2

      What are the boxes for? xD

      Windows Calculator told me I will die at 28. :(

      1 Reply Last reply
      0
      • Y youbo

        typedef struct node { char name[20]; struct node *link; }stud; stud * creat(int n) who can explain it for me?the more amply the better

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        youbo wrote:

        who can explain it...

        What?


        "A good athlete is the result of a good and worthy opponent." - David Crow

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        1 Reply Last reply
        0
        • Y youbo

          typedef struct node { char name[20]; struct node *link; }stud; stud * creat(int n) who can explain it for me?the more amply the better

          N Offline
          N Offline
          nbugalia
          wrote on last edited by
          #4

          node is a structure that looks like a link list node. typedef is used to give it a new name, that is stud. Creat is a function and it's return type is a pointer to stud. This is all, I or anyone else can tell you by looking code above. Please be specific while asking questions.

          1 Reply Last reply
          0
          • Y youbo

            typedef struct node { char name[20]; struct node *link; }stud; stud * creat(int n) who can explain it for me?the more amply the better

            J Offline
            J Offline
            John R Shaw
            wrote on last edited by
            #5

            This is C code and the typedef tells you that you can declare a variable of type “struct node” by simply typing “stud” instead of “struct node”. The “creat” function allocates, and initializes a new “stud”, which will need to be freed latter. Why an “int” is passed to it I have no idea, because it has nothing to do with the “node”, unless “creat” is doing more than just creating a new node. Oh, by the way, the name of the function should be “create” or something similar, because “creat” is an East Indian herb.

            INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups