Skip to content

Commit 2fc8c7a

Browse files
committed
C Tutorial 10
Discusses Header files & applying constants from said files in main
1 parent 0923353 commit 2fc8c7a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

C/10_cProgramming.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// This is in a header file. Go to "File" --> New -->
2+
// Empty File, call it "Buckysroom.h"
3+
4+
// Done right, a headers folder should show up on CodeBlocks
5+
6+
# define MYNAME "Bucky"
7+
# define AGE 28
8+
9+
//////////////////////////////////////////
10+
11+
12+
// Shows how values defined in header file work.
13+
14+
#include <stdio.h>
15+
#include <stdlib.h>
16+
#include "Buckysinfo.h"
17+
18+
int main()
19+
{
20+
int girlsAge = (AGE / 2) + 7;
21+
printf("%s can date girls age %d or older.", MYNAME, girlsAge);
22+
return 0;
23+
}

0 commit comments

Comments
 (0)