Simple Linked List in C Programming Lanugage

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
11,768
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Aug 22, 2010

Simple Linked List in C Programming Lanugage

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 6 dislikes

Link to this comment:

Share to:
see all

All Comments (14)

Sign In or Sign Up now to post a comment!
  • This video is harmful. The code is totally wrong w.r.t. several points:

    - Casting the result of malloc is useless.

    - Allocated structs are of the wrong size.

    - It is a miracle that its ultimate for works, the last pointer is not guaranteed to be NULL.

    I was surprised as hell that his code actually does what he expected.

    Please do not use youtube to learn programming, buy K&R.

  • Although the code is working, is has a severe and subtle problem: when allocating memory for a node, a wrong size is used, sizeof struct node *, which is 4 bytes (the size of a pointer).

    The structure node itself is larger than 4 bytes, so when an element is created and initialized, the heap is corrupted. The program works because the memory is leaked (no free is performed), but in a serious application, this bug would create crashes and would be nearly impossible to find.

  • after the first for loop add

    (clist--)->ptr= NULL;

    to make the code work

  • very simple and well made video.

  • it would be great if you could explain your code also ... i mean like step wise how it works ... it would help me very much to understand how linked list works ...

    thanks

  • i made a solution for it ...

    put flag at the end of your program if you have a problem..

    that is in a last for loop; flag++

    then put if(flag==10) { break; } so temprorary solution but for now that's all i can do :D

    thanks a lot i understood this topic because of you...

  • thanks for your help but last code is not working :D thanks a lot

  • audio is too low -.-", and need some more explanation with this pgr.

  • this program doesnt run not sure why

  • improve the voice sir

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more