小编LH1*_*395的帖子

从结构中打印通过C中的值传递

TL; DR:

printf()printLotInfo()通过值时打印垃圾.

#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <math.h>
#include <string.h>

typedef struct Time
{
   int hour;                              //Hour of day
   int minute;                            //Minute of hour
} Time;

typedef struct Car
{
   char * plateNumber;                    //String to hold plate
   char hasPermit;                        //True/False
   Time * enteringTime;                   //Time Struct
   int lotParkedIn;                       //Where is the car located
} Car;

typedef struct ParkingLot
{
   int lotNumber;                         //Lot identifier
   double hourlyRate;                     //$$/h
   double maxCharge;                      //Maximum daily charge
   int capacity;                          //How many …
Run Code Online (Sandbox Code Playgroud)

c printing printf struct

0
推荐指数
1
解决办法
81
查看次数

标签 统计

c ×1

printf ×1

printing ×1

struct ×1