E
Eirik
Look at this code:
#include <stdio.h>
int main(void) {
char name[50];
printf("What is your name?\n");
fgets(name, sizeof(name), stdin);
printf("Your name is %s.\n", name);
return 0;
}
I get the comma on a separate line. I know why, it is
because of the '\n' at the end of "name"(that's at least what
I think, but how can I remove it?
I have another question: How do real programmers in real
programs deal with memory allocation? Previously, when
I have asked questions, people have called my programs
'toy applications', which they are, because
they don't have any memory allocation. How does a
programmer that is working on a big application with
many variables do?
#include <stdio.h>
int main(void) {
char name[50];
printf("What is your name?\n");
fgets(name, sizeof(name), stdin);
printf("Your name is %s.\n", name);
return 0;
}
I get the comma on a separate line. I know why, it is
because of the '\n' at the end of "name"(that's at least what
I think, but how can I remove it?
I have another question: How do real programmers in real
programs deal with memory allocation? Previously, when
I have asked questions, people have called my programs
'toy applications', which they are, because
they don't have any memory allocation. How does a
programmer that is working on a big application with
many variables do?