I know I essentially need to replace the "\n"
with a "\0"
, but how would I access the array to incorporate this? I can not use string.h library or any other libraries.
#include <stdio.h>
#include <stdlib.h>
int main() {
char buffer[32];
char digits[3];
printf("Enter name:");
fgets(buffer,32,stdin);
printf("Enter age:");
fgets(digits,3,stdin);
char *name;
name = buffer;
int *age;
age = atoi(digits);
happyBirthday(name,age);
return 0;
}