struct vars are memory values

So i am messing in C not C++ sorry please don't burn me by the cross but i am trying to make a little player customization menu thing just to practice with structs and every time i try to output a thing eg person.name it gives off like 125123156312
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include "stdafx.h"
#include <stdio.h>

char * var1;
char * var2;
char * var3;
int var4;
int var5;
// Clotrhing Vars;
int cvar1;
int cvar2;
int cvar3;
int cvar4;
int cvar5;
int cvar6;

typedef struct {
	char dogname[100];
	char * dogbreed;
	int dogage;
	char * dogdob;
} dog;

typedef struct {
	char name[32];
	int skinc[32];
	int facialhair;
	int scars;
} person;



int main()
{

	person person;
	printf("What's your character's name?\n");
	fgets(person.name, 32, stdin);
	char * pname = person.name;
	printf("\nWhat's your character's skin color?");
	fgets(person.skinc, 32, stdin);
	char * pskin = person.skinc;
	printf("\nOk, %d This is your character cumtomization menu!\n", pname);
	printf("What would you like for head wear?\n");
	printf("[1] A helmet\n");
	printf("[2] Special hat\n");
	printf("[3] A helicopter hat\n");
	printf("[4] A baseball cap\n");
	printf("[5] Beanie\n");
	printf("[6] Painted Beanie\n");
	printf("Please select 1: ");
	fgets(cvar1, 10, stdin);
	printf("Your character is a %d named %d wearing ", pskin, pname);



	return 0;
}


// Outputs 
Ok, 6223712 This is your customization menu.
Rather than: Ok, Jimmy this is your customization menu.
closed account (E0p9LyTq)
Look real close at line 43, you are printing a string as a decimal (%d).

http://www.cplusplus.com/reference/cstdio/printf/?kw=printf
Oh thank you, i was unaware different % had different uses.
Topic archived. No new replies allowed.