Skip to content

Commit b8b4f6c

Browse files
authored
Dev-C++5.11 Projects - Studying C
Dev-C++5.11 Projects - Studying C
1 parent 32f0520 commit b8b4f6c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2449
-0
lines changed

DEVC/EX01/Makefile.win

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Project: Project
2+
# Makefile created by Dev-C++ 5.11
3+
4+
CPP = g++.exe
5+
CC = gcc.exe
6+
WINDRES = windres.exe
7+
OBJ = Project.o
8+
LINKOBJ = Project.o
9+
LIBS = -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib" -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib" -static-libgcc
10+
INCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include"
11+
CXXINCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++"
12+
BIN = Project.exe
13+
CXXFLAGS = $(CXXINCS)
14+
CFLAGS = $(INCS)
15+
RM = rm.exe -f
16+
17+
.PHONY: all all-before all-after clean clean-custom
18+
19+
all: all-before $(BIN) all-after
20+
21+
clean: clean-custom
22+
${RM} $(OBJ) $(BIN)
23+
24+
$(BIN): $(OBJ)
25+
$(CC) $(LINKOBJ) -o $(BIN) $(LIBS)
26+
27+
Project.o: Project.c
28+
$(CC) -c Project.c -o Project.o $(CFLAGS)

DEVC/EX01/Project.c

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
Studying C Types (char, int, float & double):
3+
C Data Types
4+
****************************
5+
Type Descrition Bits
6+
****************************
7+
char character 8
8+
int integer 16
9+
float floating point 32
10+
double floating point 64
11+
****************************
12+
modifiers: unsigned ( real numbers - only positive )
13+
signed ( real numbers - positive & negative)
14+
short (reduces capacity by half ) and
15+
long (doubles capacity )
16+
17+
notes:
18+
. Table above applicable for Atmega328p Microcontroller (8-bits or 16-bits);
19+
20+
. C Rule n 1 - no variable can assume the same char value;
21+
. C Rule n 2 - the absence of modifiers forces the compiler to use the signed;
22+
. C Rule n 3 - int is the standard type; if you don't indicate the type,
23+
the compiler assumes int -> 'signed count' is equal to 'signed int count'
24+
or (not modifier) 'int count';
25+
26+
. If your microcontroller is 32-bit, short assumes 16-bit;
27+
. if your microcontroller is 16-bits, the short remains 16-bits,
28+
that is, no variable can assume the same char value(C Rule n 1);
29+
30+
*****************************
31+
Output:
32+
CHAR 1 Byte(s)
33+
INT 4 Byte(s)
34+
FLOAT 4 Byte(s)
35+
DOUBLE 8 Byte(s)
36+
LONG DOUBLE 16 Byte(s)
37+
*****************************
38+
39+
Compiler: Dev C ++ Version 2 - Jun,1991
40+
(https://sourceforge.net/projects/orwelldevcpp/)
41+
42+
Author: F. Simplicio (microgenios.com.br)
43+
Edited by j3
44+
date: jun, 18/2020
45+
*/
46+
47+
#include <stdio.h>
48+
#include <stdlib.h>
49+
50+
51+
int main(void)
52+
{
53+
unsigned char a;
54+
unsigned int b;
55+
float c;
56+
double d;
57+
long double e;
58+
59+
printf("CHAR %d Byte(s)\n", sizeof(a));
60+
printf("INT %d Byte(s)\n", sizeof(b));
61+
printf("FLOAT %d Byte(s)\n", sizeof(c));
62+
printf("DOUBLE %d Byte(s)\n", sizeof(d));
63+
printf("LONG DOUBLE %d Byte(s)\n", sizeof(e));
64+
65+
//system("pause");
66+
return 0;
67+
}

DEVC/EX01/Project.dev

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
[Project]
2+
FileName=Project.dev
3+
Name=Project
4+
Type=1
5+
Ver=2
6+
ObjFiles=
7+
Includes=
8+
Libs=
9+
PrivateResource=
10+
ResourceIncludes=
11+
MakeIncludes=
12+
Compiler=
13+
CppCompiler=
14+
Linker=
15+
IsCpp=0
16+
Icon=
17+
ExeOutput=
18+
ObjectOutput=
19+
LogOutput=
20+
LogOutputEnabled=0
21+
OverrideOutput=0
22+
OverrideOutputName=
23+
HostApplication=
24+
UseCustomMakefile=0
25+
CustomMakefile=
26+
CommandLine=
27+
Folders=
28+
IncludeVersionInfo=0
29+
SupportXPThemes=0
30+
CompilerSet=0
31+
CompilerSettings=0000000000000000000000000
32+
UnitCount=1
33+
34+
[VersionInfo]
35+
Major=1
36+
Minor=0
37+
Release=0
38+
Build=0
39+
LanguageID=1033
40+
CharsetID=1252
41+
CompanyName=
42+
FileVersion=
43+
FileDescription=Developed using the Dev-C++ IDE
44+
InternalName=
45+
LegalCopyright=
46+
LegalTrademarks=
47+
OriginalFilename=
48+
ProductName=
49+
ProductVersion=
50+
AutoIncBuildNr=0
51+
SyncProduct=1
52+
53+
[Unit1]
54+
FileName=Project.c
55+
CompileCpp=0
56+
Folder=
57+
Compile=1
58+
Link=1
59+
Priority=1000
60+
OverrideBuildCmd=0
61+
BuildCmd=
62+

DEVC/EX01/Project.exe

128 KB
Binary file not shown.

DEVC/EX01/Project.layout

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[Editor_0]
2+
CursorCol=16
3+
CursorRow=44
4+
TopLine=51
5+
LeftChar=1
6+
[Editors]
7+
Order=0
8+
Focused=0

DEVC/EX01/Project.o

1.1 KB
Binary file not shown.

DEVC/EX02/Makefile.win

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Project: Project2
2+
# Makefile created by Dev-C++ 5.11
3+
4+
CPP = g++.exe
5+
CC = gcc.exe
6+
WINDRES = windres.exe
7+
OBJ = Project2.o
8+
LINKOBJ = Project2.o
9+
LIBS = -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib" -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib" -static-libgcc
10+
INCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include"
11+
CXXINCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++"
12+
BIN = Project2.exe
13+
CXXFLAGS = $(CXXINCS)
14+
CFLAGS = $(INCS)
15+
RM = rm.exe -f
16+
17+
.PHONY: all all-before all-after clean clean-custom
18+
19+
all: all-before $(BIN) all-after
20+
21+
clean: clean-custom
22+
${RM} $(OBJ) $(BIN)
23+
24+
$(BIN): $(OBJ)
25+
$(CC) $(LINKOBJ) -o $(BIN) $(LIBS)
26+
27+
Project2.o: Project2.c
28+
$(CC) -c Project2.c -o Project2.o $(CFLAGS)

DEVC/EX02/Project2.c

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
Simple use of modifiers:
3+
'long' and 'short' is applicable only for integers!
4+
5+
Exception: 'long double'
6+
7+
*****************************
8+
Output:
9+
U_INT 4
10+
U_SHORT_INT 2
11+
U_LONG_INT 4
12+
U_LONG_LONG_INT 8
13+
14+
DOUBLE 8
15+
LONG_DOUBLE 16
16+
*****************************
17+
18+
Compiler: Dev C ++ Version 2 - Jun,1991
19+
(https://sourceforge.net/projects/orwelldevcpp/)
20+
21+
Author: F. Simplicio (microgenios.com.br)
22+
Edited by j3
23+
date: jun, 18/2020
24+
*/
25+
26+
27+
#include <stdio.h>
28+
#include <stdlib.h>
29+
30+
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
31+
32+
int main(void)
33+
{
34+
// The modifiers 'long' and 'short' is applicable only for integers!
35+
unsigned int a;
36+
unsigned short int b;
37+
unsigned long int c;
38+
unsigned long long int d;
39+
40+
printf("U_INT %d\n", sizeof(a));
41+
printf("U_SHORT_INT %d\n", sizeof(b));
42+
printf("U_LONG_INT %d\n", sizeof(c));
43+
printf("U_LONG_LONG_INT %d\n", sizeof(d));
44+
45+
// exception : long double
46+
double e;
47+
long double f;
48+
printf("\nDOUBLE %d\n", sizeof(e));
49+
printf("LONG_DOUBLE %d\n", sizeof(f));
50+
51+
//system("pause");
52+
return 0;
53+
}

DEVC/EX02/Project2.dev

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
[Project]
2+
FileName=Project2.dev
3+
Name=Project2
4+
Type=1
5+
Ver=2
6+
ObjFiles=
7+
Includes=
8+
Libs=
9+
PrivateResource=
10+
ResourceIncludes=
11+
MakeIncludes=
12+
Compiler=
13+
CppCompiler=
14+
Linker=
15+
IsCpp=0
16+
Icon=
17+
ExeOutput=
18+
ObjectOutput=
19+
LogOutput=
20+
LogOutputEnabled=0
21+
OverrideOutput=0
22+
OverrideOutputName=
23+
HostApplication=
24+
UseCustomMakefile=0
25+
CustomMakefile=
26+
CommandLine=
27+
Folders=
28+
IncludeVersionInfo=0
29+
SupportXPThemes=0
30+
CompilerSet=0
31+
CompilerSettings=0000000000000000000000000
32+
UnitCount=1
33+
34+
[VersionInfo]
35+
Major=1
36+
Minor=0
37+
Release=0
38+
Build=0
39+
LanguageID=1033
40+
CharsetID=1252
41+
CompanyName=
42+
FileVersion=
43+
FileDescription=Developed using the Dev-C++ IDE
44+
InternalName=
45+
LegalCopyright=
46+
LegalTrademarks=
47+
OriginalFilename=
48+
ProductName=
49+
ProductVersion=
50+
AutoIncBuildNr=0
51+
SyncProduct=1
52+
53+
[Unit1]
54+
FileName=Project2.c
55+
CompileCpp=0
56+
Folder=
57+
Compile=1
58+
Link=1
59+
Priority=1000
60+
OverrideBuildCmd=0
61+
BuildCmd=
62+

DEVC/EX02/Project2.exe

128 KB
Binary file not shown.

DEVC/EX02/Project2.layout

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[Editors]
2+
Order=0
3+
Focused=0
4+
[Editor_0]
5+
CursorCol=24
6+
CursorRow=11
7+
TopLine=1
8+
LeftChar=1

DEVC/EX02/Project2.o

1.12 KB
Binary file not shown.

DEVC/EX03/Makefile.win

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Project: Project3
2+
# Makefile created by Dev-C++ 5.11
3+
4+
CPP = g++.exe
5+
CC = gcc.exe
6+
WINDRES = windres.exe
7+
OBJ = Project3.o
8+
LINKOBJ = Project3.o
9+
LIBS = -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib" -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib" -static-libgcc
10+
INCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include"
11+
CXXINCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++"
12+
BIN = Project3.exe
13+
CXXFLAGS = $(CXXINCS)
14+
CFLAGS = $(INCS)
15+
RM = rm.exe -f
16+
17+
.PHONY: all all-before all-after clean clean-custom
18+
19+
all: all-before $(BIN) all-after
20+
21+
clean: clean-custom
22+
${RM} $(OBJ) $(BIN)
23+
24+
$(BIN): $(OBJ)
25+
$(CC) $(LINKOBJ) -o $(BIN) $(LIBS)
26+
27+
Project3.o: Project3.c
28+
$(CC) -c Project3.c -o Project3.o $(CFLAGS)

0 commit comments

Comments
 (0)