[ create a new paste ] login | about

Link: http://codepad.org/4MQgcmy7    [ raw code | output | fork ]

C, pasted on Sep 27:
#include <stdio.h>
#include <stdbool.h>
#include <string.h>

typedef struct {
    int yearOfManufacture;
    char model[50];
    bool gasoline;
} Car;


void PrintCarDetails(Car *details);

int main (int argc, const char * argv[]) 
{        
    Car ford;
    ford.yearOfManufacture = 1997;
    ford.gasoline = true;
    strcpy(ford.model, "Focus");

    PrintCarDetails(&ford);

     return 0;
}

void PrintCarDetails(Car *details)
{
    printf("Car model %s", details->model);
}


Output:
1
Car model Focus


Create a new paste based on this one


Comments: