Skip to content

why am I getting a question mark in terminal? #151

Description

@Razvan-drb

I have written the code in lesson 9 just like described, but I am getting a question mark at the end of my name.
#include <stdio.h>
#include <stdlib.h>

int main()
{

int age;
int currentYear;
int birthYear;

currentYear = 2019;
birthYear = 1989;
age = currentYear - birthYear;

printf("Razvan is %d years old \n", age);

char name[6] = "Razvan";
printf("My name is %s \n", name);

name[3] = 'w';
printf("My name is %s \n", name);

char food[] = "bacon";
printf("The best food is %s \n", food);

strcpy(food, "sarmale");
printf("But not after %s \n", food);



return 0;

}
Capture d’écran 2019-11-27 à 14 45 59

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions