mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 04:12:13 +00:00
added print function
This commit is contained in:
parent
241fab2462
commit
25a3d10aa3
@ -1,5 +1,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "GildedRose.h"
|
#include "GildedRose.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
Item*
|
Item*
|
||||||
init_item(Item* item, const char *name, int sellIn, int quality)
|
init_item(Item* item, const char *name, int sellIn, int quality)
|
||||||
@ -11,7 +12,14 @@ init_item(Item* item, const char *name, int sellIn, int quality)
|
|||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_quality(Item items[], int size)
|
extern char*
|
||||||
|
print_item(char* buffer, Item* item)
|
||||||
|
{
|
||||||
|
sprintf(buffer, "%s, %d, %d", item->name, item->sellIn, item->quality);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
update_quality(Item items[], int size)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,6 @@
|
|||||||
|
#ifndef ROSE_INCLUDED
|
||||||
|
#define ROSE_INCLUDED
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
@ -7,3 +10,6 @@ typedef struct
|
|||||||
|
|
||||||
extern Item* init_item(Item* item, const char *name, int sellIn, int quality);
|
extern Item* init_item(Item* item, const char *name, int sellIn, int quality);
|
||||||
extern void update_quality(Item items[], int size);
|
extern void update_quality(Item items[], int size);
|
||||||
|
extern char* print_item(char* buffer, Item* item);
|
||||||
|
|
||||||
|
#endif
|
||||||
Loading…
Reference in New Issue
Block a user