Race simulator in c only printing first letter of name and color

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

// Structures section
struct Race{
int numberOfLaps;
int currentLap;
char firstPlaceDriverName[20];
char firstPlaceRaceCarColor[10];

struct RaceCar{
char driverName[20];
char raceCarColor[10];
int totalLapTime;


// Print functions section
void printIntro(void){
printf(“Welcome to our main event digital race fans! \n I hope everybody has their snacks because we are about to begin!\n”);
void printCountDown(void){
printf(“Racers Ready! In…\n 5 \n 4 \n 3 \n 2 \n 1 \n RACE!!!\n”);
void printFirstPlaceAfterLap(struct Race race){
printf(“After lap number %d\n”, race.currentLap );
printf(“First place is %s in the %s car!\n”,race.firstPlaceDriverName, race.firstPlaceRaceCarColor);
void printCongratulation(struct Race race){
printf(“Let’s all congratulate %s in the %s race car for an amazing performance!\n It truly was a great race and everybody have a goodnight!”, race.firstPlaceDriverName, race.firstPlaceRaceCarColor);
// Logic functions section
int calculateTimeToCompleteLap(void){
int speed= (rand()%3)+1;
int acceleration= (rand()%3)+1;
int nerves=(rand()%3)+1;
int all= speed+ acceleration+ nerves;
return all;
void updateRaceCar(struct RaceCar* racecar){
racecar->totalLapTime+= calculateTimeToCompleteLap();

void updateFirstPlace(struct Race* race, struct RaceCar* raceCar1, struct RaceCar* raceCar2){
if (raceCar1->totalLapTime<= raceCar2->totalLapTime){
*race->firstPlaceDriverName= *raceCar1->driverName;
*race->firstPlaceRaceCarColor = *raceCar1->raceCarColor;
*race->firstPlaceDriverName= *raceCar2->driverName;
race->firstPlaceRaceCarColor = raceCar2->raceCarColor;
void startRace(struct RaceCar
raceCar1, struct RaceCar
struct Race race= {5,1,“”,“”};
for (int i=0;i< race.numberOfLaps; i++){
updateFirstPlace(&race, raceCar1, raceCar2);


int main() {
struct RaceCar raceCar1 = {
.driverName = “Ant”,
.raceCarColor = “Green”,
.totalLapTime = 0

struct RaceCar raceCar2 = {
    .driverName = "Taylor",
    .raceCarColor = "Black",
    .totalLapTime = 0

startRace(&raceCar1, &raceCar2);


That is my code and for some reason it is only printing the first letter of each name and the color- I have no idea why!!

Without proper formatting, it can be difficult to understand the code and identify any potential issues.

Have a look at this post on how to format code in forum posts:

Short version: Click the </> button in the post editor and copy paste your entire code so that you will end up with something like:

Paste your code in between the triple backticks
The opening and closing backticks should be on
blank lines.