인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

ksu0640185436's profile image
ksu0640185436

asked

C Programming - From Introduction to Game Development

Project (First Half)

Initcats를 배열로 초기화해서 출력을 어떻게 할수있을까요?

Written on

·

191

0

void initCats() 

{

cats[0].name = "깜냥이";

cats[0].age=5;

이렇게 선언하는 부분에서 일일히 쓰지 않고

배열처럼 

struct CAT cats[5] = 

{

{"깜냥이",5,"온순",1 },

{"귀요미",3,"날카로움",2},

{"수줍이",7,"늘 잠만 잠",3},

{"까꿍이",2,"시끄러움",4},

{"돼냥이",1,"배고픔",5}

};

이렇게 선언해서 출력해보고 싶어서 시도해봤는데 포인터랑 어떻게 활용할지 해결이 잘 안됩니다 ㅠㅠ

혹시 이게 가능한지, 가능하면 어떻게 처리할수있는지 알려주세요!

c

Answer

This question is waiting for answers
Be the first to answer!
ksu0640185436's profile image
ksu0640185436

asked

Ask a question