+ 2

Input in the same line in C

This ( https://code.sololearn.com/cg41nmxdEzQP/#c ) is my simple input program. I tried something like a "form", where the output syntax looks like: ------------------------------------ <message> : <user-input> <another-message> : <result> ------------------------------------ But, my code isn't working. What is the reason behind it? And, how can I get my desired "form" output?

26th Nov 2018, 1:24 PM
777
777 - avatar
1 Antwort
+ 1
1. Add library #include<stdlib.h> at the beginning 2. Allocate memory for your string name. char* name = malloc(256); 3. If you want free memory using free(name);
26th Nov 2018, 1:49 PM
Prokopios Poulimenos
Prokopios Poulimenos - avatar