Doesn't work :( If write a bigger string then STR_SERIAL, program don't stop
case 1:
printf("Create a new component\n");
do {
printf("Serial number?\n");
...
Type: Posts; User: marcoesteves
Doesn't work :( If write a bigger string then STR_SERIAL, program don't stop
case 1:
printf("Create a new component\n");
do {
printf("Serial number?\n");
...
Or I don't understand or something is missing.
I change my code to this,
printf("Create a new component\n");
do {
printf("Serial number?\n");
fgets(c_description, STR_SERIAL,...
Ok. I'll try a mix of the advices to get a nice solution.
My program is full funtional. But the "basic things" don't work. This is make me mad :D
So, remove all fflush.
Create a dump_line function and call it after fgets?
Thanks for the tips.
Just to make clear.
Your advice is use fgets to get strings and sscanf to get the float value of price?
Hello people.
I'm getting problems with fgets.
while (run) {
printMenu();
scanf("%d*c", &opt);
switch (opt) {
case 1:
printf("Create a new component\n");