mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 12:22:12 +00:00
added print function
This commit is contained in:
parent
241fab2462
commit
25a3d10aa3
@ -1,5 +1,6 @@
|
||||
#include <string.h>
|
||||
#include "GildedRose.h"
|
||||
#include <stdio.h>
|
||||
|
||||
Item*
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
#ifndef ROSE_INCLUDED
|
||||
#define ROSE_INCLUDED
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
@ -7,3 +10,6 @@ typedef struct
|
||||
|
||||
extern Item* init_item(Item* item, const char *name, int sellIn, int quality);
|
||||
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