What do you think please the error is??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What do you think please the error is???

A project for product ,clients and commands system management Build using linked list data structures. https://code.sololearn.com/cM8SZ5MhhWkr/?ref=app

11th Jun 2020, 1:38 AM
Amal Gil
Amal Gil - avatar
5 Answers
+ 2
There are really many errors in your huge program... some of them prevent the code to be compiled (e.g. line 576: one space in the name of the function), some other are logical errors. It sounds like you have written the program all at once, and not step by step. If I were you, I would start making all functions empty: put "#if 0" and "#endif" at start and at end of every function, just returning 0 in order to make the compiler happy... Then, when you have something compilable, I would enable the functions one by one, removing '#if 0' and '#endif', compiling and testing each one. Just to start with the main(): - what is the sense of malloc() for a list with one element, and then putting its pointer to NULL? This is called "memory leak": you are wasting some memory that will never be seen by the program - you cannot write "login==amal" or "password==gilgil": amal and gilgil are names unknown to the compiler, and strings must be compared using strcmp(), like this: if (strcmp(login,"amal")==0)
11th Jun 2020, 3:59 AM
Bilbo Baggins
Bilbo Baggins - avatar
+ 3
Bilbo Baggins thank you ๐Ÿ‘๐Ÿ‘๐Ÿ‘
11th Jun 2020, 3:18 PM
Amal Gil
Amal Gil - avatar
+ 2
Bilbo Baggins you are absolutely right I know that my program is full of logical and syntax error. This my first programming ever so I don't have enough experience. Besides this the code is very huge, it should be optimised.
11th Jun 2020, 10:23 AM
Amal Gil
Amal Gil - avatar
+ 2
Never mind, amal 01, I too make a lot of errors after more than 40 years of passionate programming... Again, the only thing I suggest you is to develop things step by step, without trying to develop the whole project in a single step. The optimizations (for example, use only one set of functions for the three linked lists) will come even later, when things are running and debugged... And the most important thing... using Sia words, never give up!
11th Jun 2020, 2:50 PM
Bilbo Baggins
Bilbo Baggins - avatar
+ 1
Line 71 must be if (liste == NULL) ... and a lot of pointer-/ no-pointer-mess.
11th Jun 2020, 2:19 AM
Sandra Meyer
Sandra Meyer - avatar