Skip to content

Commit abf5ffc

Browse files
author
arteknix
committed
sources for Lesson01
1 parent cdda746 commit abf5ffc

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include "extras.h"
2+
3+
/**/
4+
void
5+
printSome(void)
6+
{
7+
//variable declarations and initialisations
8+
int age = 123;
9+
float pi = 3.14159265358979;
10+
char* name = "bugs bunny";
11+
banana bigNum = 1329;
12+
printf("%d\n",bigNum);
13+
printf("\nHello C - %s - !\nMy name is %s, and I'm %d years old. I love %f π \n", __FILE__, name, age, pi);
14+
}
15+
16+
/**/
17+
void
18+
printMore(int num, char* table[])
19+
{
20+
for(int i = 0; i<num; i++)
21+
{
22+
printf("table[%d] = %s \n",i,table[i]);
23+
}
24+
}
25+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#ifndef EXTRAS_H_
2+
#define EXTRAS_H_ 1
3+
4+
#include <stdio.h>
5+
#include <stdint.h>
6+
7+
typedef uint16_t banana;
8+
9+
void printSome(void);
10+
void printMore(int num, char** table);
11+
12+
#endif
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* arteknix
2+
this is an example with more sources and headers
3+
compiled separately
4+
*/
5+
#include <stdio.h> // first system
6+
#include "extras.h" // then local
7+
8+
int
9+
main(int argc, char* argv[])
10+
{
11+
printf("\nHello C - %s [%s] -\n", __FILE__, __DATE__);
12+
printSome();
13+
printMore(argc,argv);
14+
return 0;
15+
}
16+
17+
18+
19+
//printf("\nHello C -with args- !\n%d args, for program %s\n", argc, argv[0]);

0 commit comments

Comments
 (0)