-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9186b78
commit fe9972f
Showing
25 changed files
with
142 additions
and
36 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#include <stdio.h> | ||
#include <string.h> | ||
#include <ctype.h> | ||
#define LIMIT 81 | ||
void to_upper (char * str); | ||
int punct_count (const char *str); | ||
|
||
int main (void) | ||
{ | ||
char line[LIMIT]; | ||
char * find; | ||
|
||
puts ("please enter a line: "); | ||
fgets (line, LIMIT, stdin); | ||
find = strchr (line, '\n'); | ||
if (find) | ||
{ | ||
*find = '\0'; | ||
} | ||
to_upper (line); | ||
puts (line); | ||
printf ("That line has %d punctuation characters. \n", punct_count (line)); | ||
|
||
return 0; | ||
} | ||
void to_upper (char * str) | ||
{ | ||
while (*str) | ||
{ | ||
if (islower (*str)) | ||
{ | ||
*str = toupper (*str); | ||
} | ||
str ++; | ||
} | ||
} | ||
int punct_count (const char * str) | ||
{ | ||
int ct; | ||
|
||
for (ct = 0; *str; str ++) | ||
{ | ||
if (ispunct (*str)) | ||
{ | ||
ct ++; | ||
} | ||
} | ||
|
||
return ct; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include <stdio.h> | ||
int main (int argc, char * argv[]) | ||
{ | ||
int count; | ||
|
||
printf ("The command line has %d arguments: \n", argc - 1); | ||
for (count = 0; count < argc; count ++) | ||
{ | ||
printf ("%d: %s\n", count, argv[count]); | ||
} | ||
printf ("\n"); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
int main (int argc, char * argv[]) | ||
{ | ||
int i, times; | ||
|
||
if (argc < 2 || (times = atoi (argv[1])) < 1) | ||
{ | ||
printf ("Usage: %s positive-number\n", argv[0]); | ||
}else | ||
{ | ||
for (i = 0; i < times; i ++) | ||
{ | ||
puts ("Hello, goodlooking!"); | ||
} | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "s_gets.h" | ||
#include <stdlib.h> | ||
#define LIM 30 | ||
int main (void) | ||
{ | ||
char number[LIM]; | ||
char * end; | ||
long value; | ||
|
||
puts ("Enter a number(empty line to quit):"); | ||
while (s_gets (number, LIM) && number[0]) | ||
{ | ||
value = strtol (number, &end, 10); | ||
printf ("base 10 input, base 10 output: %ld, stopped at %s(%d)\n", value, end, *end); | ||
value = strtol (number, &end, 16); | ||
printf ("base 16 input, base 10 output: %ld, stopped at %s(%d)\n", value, end, *end); | ||
puts ("Next number:"); | ||
} | ||
puts ("Bye."); | ||
|
||
return 0; | ||
} |
Empty file.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,37 @@ | ||
# ninja log v5 | ||
1 650 1705728959565596464 CMakeFiles/C_primer.dir/11/11/11.28.c.o 879ba678eb7659d3 | ||
1 139 1705655794891216181 CMakeFiles/C_primer.dir/11/11/11.26.c.o 60cd9bd27e13dee9 | ||
4 335 1702822896367170007 CMakeFiles/C_primer.dir/9_plus/9_plus/9.36.c.o 9f95dd8b31879556 | ||
3 743 1705477691140561907 CMakeFiles/C_primer.dir/11/11/11.20.c.o 4d41b33316ec8196 | ||
8 399 1703341888623019922 CMakeFiles/C_primer.dir/10_plus_2/10_plus_2/10.27.c.o c931a25c28b6f776 | ||
1 314 1705426175402873873 CMakeFiles/C_primer.dir/11/11/ttttttt.c.o e65d1f4f85245257 | ||
1 768 1703335314154911819 CMakeFiles/C_primer.dir/10_plus/10.27.c.o e943e8b249a83691 | ||
1 143 1705647977382829895 CMakeFiles/C_primer.dir/11/11/11.23.c.o 8d1dd77d660222d8 | ||
0 305 1702822896335875576 CMakeFiles/C_primer.dir/9_plus/9_plus/9.35.c.o c09ce47479a5514a | ||
1 79 1704987149621406781 CMakeFiles/C_primer.dir/11/11/11.18.c.o a8a9353c4b47a706 | ||
1 213 1705593199876040862 CMakeFiles/C_primer.dir/11/11/11.22.c.o aeaa032b253b3f6 | ||
1 187 1705656507378973250 CMakeFiles/C_primer.dir/11/11/11.27.c.o 2d5ba875468ac8fb | ||
1 182 1705478273108029140 CMakeFiles/C_primer.dir/11/11/11.21.c.o a5f1d6b58ebbc38e | ||
1 650 1705728959565596464 CMakeFiles/C_primer.dir/11/11/11.28.c.o 879ba678eb7659d3 | ||
1 307 1706098844786149859 CMakeFiles/C_primer.dir/11/11/11.33.c.o df87872c3f711417 | ||
4 335 1702822896367170007 CMakeFiles/C_primer.dir/9_plus/9_plus/9.36.c.o 9f95dd8b31879556 | ||
1 139 1705655794891216181 CMakeFiles/C_primer.dir/11/11/11.26.c.o 60cd9bd27e13dee9 | ||
1 144 1702825381558358062 CMakeFiles/C_primer.dir/10_plus/10.14.c.o 27c11ea85739635 | ||
0 133 1705807674707591764 CMakeFiles/C_primer.dir/11/11/11.29.c.o 4578e5e29e3d0feb | ||
1 182 1705478273108029140 CMakeFiles/C_primer.dir/11/11/11.21.c.o a5f1d6b58ebbc38e | ||
1 139 1703332966115689949 CMakeFiles/C_primer.dir/10_plus/10.26.c.o 1fb19967a9825110 | ||
4 212 1706068902889082467 CMakeFiles/C_primer.dir/11/11/11.29.c.o 4578e5e29e3d0feb | ||
0 712 1703213310905304912 CMakeFiles/C_primer.dir/10_plus/10.28.c.o c90e9088be1fd995 | ||
1 94 1705649854118681712 CMakeFiles/C_primer.dir/11/11/11.24.c.o 9c813ca189b53dc | ||
0 267 1702717481449984888 CMakeFiles/C_primer.dir/10_plus/10.12.c.o d0b2887c66daa4b1 | ||
1 100 1705652108918433891 CMakeFiles/C_primer.dir/11/11/11.25.c.o 9311352dfbe1bec9 | ||
1 137 1705807674711430391 CMakeFiles/C_primer.dir/11/11/s_gets.c.o 482640b116f7f053 | ||
2 620 1703211568893536340 CMakeFiles/C_primer.dir/10_plus/10.25.c.o df8f1239080514a | ||
2 401 1705812436533746761 CMakeFiles/C_primer.dir/11/11/s_gets.c.o 482640b116f7f053 | ||
2 247 1705292200850914317 CMakeFiles/C_primer.dir/11/11/11.19.c.o fe1937fff2522a0d | ||
2 620 1703211568893536340 CMakeFiles/C_primer.dir/10_plus/10.25.c.o df8f1239080514a | ||
0 431 1702958013825178426 CMakeFiles/C_primer.dir/10_plus/10.15.c.o 3cd52d55636f54b | ||
0 434 1705811550674513896 build.ninja 40ffa430796bc747 | ||
1 138 1702825381555261318 CMakeFiles/C_primer.dir/10_plus/10.13.c.o 7bef308e0e43b8ac | ||
0 434 1706154972780235704 build.ninja 40ffa430796bc747 | ||
3 161 1705810764224886659 CMakeFiles/C_primer.dir/count_all_codes.c.o bc1d9f2637b19595 | ||
164 351 1705810764413024005 C_primer cc79695adb62baee | ||
1 138 1702825381555261318 CMakeFiles/C_primer.dir/10_plus/10.13.c.o 7bef308e0e43b8ac | ||
0 305 1702822896335875576 CMakeFiles/C_primer.dir/9_plus/9_plus/9.35.c.o c09ce47479a5514a | ||
0 324 1706073988864655653 CMakeFiles/C_primer.dir/11/11/11.22.c.o aeaa032b253b3f6 | ||
1 79 1704987149621406781 CMakeFiles/C_primer.dir/11/11/11.18.c.o a8a9353c4b47a706 | ||
1 143 1705647977382829895 CMakeFiles/C_primer.dir/11/11/11.23.c.o 8d1dd77d660222d8 | ||
1 206 1706075451077411555 CMakeFiles/C_primer.dir/11/11/11.30.c.o febb14f1edb3a233 | ||
1 187 1705656507378973250 CMakeFiles/C_primer.dir/11/11/11.27.c.o 2d5ba875468ac8fb | ||
1 875 1706079728948015842 CMakeFiles/C_primer.dir/11/11/11.31.c.o 7de9de148e61df4 | ||
308 669 1706098845155881141 C_primer abb35006aea92dea | ||
0 398 1703341888622940162 CMakeFiles/C_primer.dir/10_plus_2/10_plus_2/10.26.c.o eac4638a5b3bb1a6 | ||
2 401 1705812436533746761 CMakeFiles/C_primer.dir/11/11/s_gets.c.o 482640b116f7f053 | ||
1 415 1705812436555428092 CMakeFiles/C_primer.dir/11/11/11.30.c.o febb14f1edb3a233 | ||
415 586 1705812436732955345 C_primer 502a84d303e7a6f0 | ||
0 112 1705812463562054893 CMakeFiles/C_primer.dir/11/11/11.30.c.o febb14f1edb3a233 | ||
113 287 1705812463732136563 C_primer 502a84d303e7a6f0 | ||
3 743 1705477691140561907 CMakeFiles/C_primer.dir/11/11/11.20.c.o 4d41b33316ec8196 | ||
1 133 1706097471309179618 CMakeFiles/C_primer.dir/11/11/11.32.c.o 8ee2316f627a1f04 | ||
1 768 1703335314154911819 CMakeFiles/C_primer.dir/10_plus/10.27.c.o e943e8b249a83691 | ||
6 885 1706165152516904273 CMakeFiles/C_primer.dir/11/11/s_gets.c.o 482640b116f7f053 | ||
1 921 1706165152567909895 CMakeFiles/C_primer.dir/11/11/11.34.c.o e27bf47f490c34e2 | ||
921 1715 1706165153370313198 C_primer f1de7d88473b4b10 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/Applications/CLion.app/Contents/bin/cmake/mac/x64/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/Applications/CLion.app/Contents/bin/ninja/mac/x64/ninja -G Ninja -S /Users/tgspock/Documents/GitHub/learn_c_primer.github.io -B /Users/tgspock/Documents/GitHub/learn_c_primer.github.io/cmake-build-debug | ||
-- Configuring done (0.1s) | ||
-- Configuring done (0.2s) | ||
-- Generating done (0.0s) | ||
-- Build files have been written to: /Users/tgspock/Documents/GitHub/learn_c_primer.github.io/cmake-build-debug |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Start testing: Jan 21 12:47 CST | ||
Start testing: Jan 25 14:45 CST | ||
---------------------------------------------------------- | ||
End testing: Jan 21 12:47 CST | ||
End testing: Jan 25 14:45 CST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters