diff --git a/.DS_Store b/.DS_Store index 40d0ffe..39cd571 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/11/.DS_Store b/11/.DS_Store index d1c60f5..a94b464 100644 Binary files a/11/.DS_Store and b/11/.DS_Store differ diff --git a/11/11/11.30.c b/11/11/11.30.c index 5af71e4..6537acf 100644 --- a/11/11/11.30.c +++ b/11/11/11.30.c @@ -1,7 +1,6 @@ #include "s_gets.h" #define SIZE 81 #define LIM 20 -#define HALT "" void stsrt (char *strings[], int num) { @@ -25,7 +24,7 @@ void stsrt (char *strings[], int num) int main (void) { char input[LIM][SIZE]; - char *ptstr[LIM]; + char * ptstr[LIM]; int ct = 0; int k; @@ -37,7 +36,7 @@ int main (void) ct ++; } stsrt (ptstr, ct); - puts ("\nHere's the sort list: \n"); + puts ("Here's the sort list: \n"); for (k = 0; k < ct; k ++) { puts (ptstr[k]); diff --git a/11/11/11.31.c b/11/11/11.31.c new file mode 100644 index 0000000..b82ced7 --- /dev/null +++ b/11/11/11.31.c @@ -0,0 +1,50 @@ +#include +#include +#include +#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; +} \ No newline at end of file diff --git a/11/11/11.32.c b/11/11/11.32.c new file mode 100644 index 0000000..68f414e --- /dev/null +++ b/11/11/11.32.c @@ -0,0 +1,14 @@ +#include +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; +} \ No newline at end of file diff --git a/11/11/11.33.c b/11/11/11.33.c new file mode 100644 index 0000000..bb9e986 --- /dev/null +++ b/11/11/11.33.c @@ -0,0 +1,19 @@ +#include +#include +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; +} \ No newline at end of file diff --git a/11/11/11.34.c b/11/11/11.34.c new file mode 100644 index 0000000..89e863c --- /dev/null +++ b/11/11/11.34.c @@ -0,0 +1,22 @@ +#include "s_gets.h" +#include +#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; +} \ No newline at end of file diff --git a/11/11/11.35.c b/11/11/11.35.c new file mode 100644 index 0000000..e69de29 diff --git a/11/11/hello b/11/11/hello new file mode 100755 index 0000000..3d8a948 Binary files /dev/null and b/11/11/hello differ diff --git a/11/11/repeat b/11/11/repeat new file mode 100755 index 0000000..5cdfdc5 Binary files /dev/null and b/11/11/repeat differ diff --git a/CMakeLists.txt b/CMakeLists.txt index 848e52c..8ae19bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,5 +6,5 @@ set(CMAKE_CXX_STANDARD 14) include_directories(9) add_executable(C_primer - 11/11/11.30.c 11/11/s_gets.c + 11/11/11.34.c 11/11/s_gets.c ) diff --git a/cmake-build-debug/.cmake/api/v1/reply/codemodel-v2-570e37c8900be2a43840.json b/cmake-build-debug/.cmake/api/v1/reply/codemodel-v2-bc71b87dc24d23e97fec.json similarity index 93% rename from cmake-build-debug/.cmake/api/v1/reply/codemodel-v2-570e37c8900be2a43840.json rename to cmake-build-debug/.cmake/api/v1/reply/codemodel-v2-bc71b87dc24d23e97fec.json index 7c78a92..dd446a4 100644 --- a/cmake-build-debug/.cmake/api/v1/reply/codemodel-v2-570e37c8900be2a43840.json +++ b/cmake-build-debug/.cmake/api/v1/reply/codemodel-v2-bc71b87dc24d23e97fec.json @@ -39,7 +39,7 @@ { "directoryIndex" : 0, "id" : "C_primer::@6890427a1f51a3e7e1df", - "jsonFile" : "target-C_primer-Debug-c6656e18f983ae479999.json", + "jsonFile" : "target-C_primer-Debug-2506983990cec0ab17b4.json", "name" : "C_primer", "projectIndex" : 0 } diff --git a/cmake-build-debug/.cmake/api/v1/reply/index-2024-01-21T04-32-30-0706.json b/cmake-build-debug/.cmake/api/v1/reply/index-2024-01-25T03-56-12-0842.json similarity index 93% rename from cmake-build-debug/.cmake/api/v1/reply/index-2024-01-21T04-32-30-0706.json rename to cmake-build-debug/.cmake/api/v1/reply/index-2024-01-25T03-56-12-0842.json index 2f6d584..64934b4 100644 --- a/cmake-build-debug/.cmake/api/v1/reply/index-2024-01-21T04-32-30-0706.json +++ b/cmake-build-debug/.cmake/api/v1/reply/index-2024-01-25T03-56-12-0842.json @@ -26,7 +26,7 @@ "objects" : [ { - "jsonFile" : "codemodel-v2-570e37c8900be2a43840.json", + "jsonFile" : "codemodel-v2-bc71b87dc24d23e97fec.json", "kind" : "codemodel", "version" : { @@ -86,7 +86,7 @@ }, "codemodel-v2" : { - "jsonFile" : "codemodel-v2-570e37c8900be2a43840.json", + "jsonFile" : "codemodel-v2-bc71b87dc24d23e97fec.json", "kind" : "codemodel", "version" : { diff --git a/cmake-build-debug/.cmake/api/v1/reply/target-C_primer-Debug-c6656e18f983ae479999.json b/cmake-build-debug/.cmake/api/v1/reply/target-C_primer-Debug-2506983990cec0ab17b4.json similarity index 98% rename from cmake-build-debug/.cmake/api/v1/reply/target-C_primer-Debug-c6656e18f983ae479999.json rename to cmake-build-debug/.cmake/api/v1/reply/target-C_primer-Debug-2506983990cec0ab17b4.json index 314b1b7..7f86817 100644 --- a/cmake-build-debug/.cmake/api/v1/reply/target-C_primer-Debug-c6656e18f983ae479999.json +++ b/cmake-build-debug/.cmake/api/v1/reply/target-C_primer-Debug-2506983990cec0ab17b4.json @@ -99,7 +99,7 @@ { "backtrace" : 1, "compileGroupIndex" : 0, - "path" : "11/11/11.30.c", + "path" : "11/11/11.34.c", "sourceGroupIndex" : 0 }, { diff --git a/cmake-build-debug/.ninja_deps b/cmake-build-debug/.ninja_deps index 4a15b06..1a66ef7 100644 Binary files a/cmake-build-debug/.ninja_deps and b/cmake-build-debug/.ninja_deps differ diff --git a/cmake-build-debug/.ninja_log b/cmake-build-debug/.ninja_log index e237577..44ae381 100644 --- a/cmake-build-debug/.ninja_log +++ b/cmake-build-debug/.ninja_log @@ -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 diff --git a/cmake-build-debug/CMakeFiles/C_primer.dir/11/11/11.30.c.o b/cmake-build-debug/CMakeFiles/C_primer.dir/11/11/11.30.c.o index 312e6df..ebad6f9 100644 Binary files a/cmake-build-debug/CMakeFiles/C_primer.dir/11/11/11.30.c.o and b/cmake-build-debug/CMakeFiles/C_primer.dir/11/11/11.30.c.o differ diff --git a/cmake-build-debug/CMakeFiles/C_primer.dir/11/11/11.31.c.o b/cmake-build-debug/CMakeFiles/C_primer.dir/11/11/11.31.c.o new file mode 100644 index 0000000..7787a83 Binary files /dev/null and b/cmake-build-debug/CMakeFiles/C_primer.dir/11/11/11.31.c.o differ diff --git a/cmake-build-debug/CMakeFiles/C_primer.dir/11/11/11.32.c.o b/cmake-build-debug/CMakeFiles/C_primer.dir/11/11/11.32.c.o new file mode 100644 index 0000000..3d2ceb9 Binary files /dev/null and b/cmake-build-debug/CMakeFiles/C_primer.dir/11/11/11.32.c.o differ diff --git a/cmake-build-debug/CMakeFiles/C_primer.dir/11/11/11.33.c.o b/cmake-build-debug/CMakeFiles/C_primer.dir/11/11/11.33.c.o new file mode 100644 index 0000000..66ccdd9 Binary files /dev/null and b/cmake-build-debug/CMakeFiles/C_primer.dir/11/11/11.33.c.o differ diff --git a/cmake-build-debug/CMakeFiles/C_primer.dir/11/11/11.34.c.o b/cmake-build-debug/CMakeFiles/C_primer.dir/11/11/11.34.c.o new file mode 100644 index 0000000..f3c0a69 Binary files /dev/null and b/cmake-build-debug/CMakeFiles/C_primer.dir/11/11/11.34.c.o differ diff --git a/cmake-build-debug/CMakeFiles/clion-Debug-log.txt b/cmake-build-debug/CMakeFiles/clion-Debug-log.txt index b058ea6..f3d6933 100644 --- a/cmake-build-debug/CMakeFiles/clion-Debug-log.txt +++ b/cmake-build-debug/CMakeFiles/clion-Debug-log.txt @@ -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 diff --git a/cmake-build-debug/C_primer b/cmake-build-debug/C_primer index cbdcd92..1401a57 100755 Binary files a/cmake-build-debug/C_primer and b/cmake-build-debug/C_primer differ diff --git a/cmake-build-debug/Testing/Temporary/LastTest.log b/cmake-build-debug/Testing/Temporary/LastTest.log index be0feaa..8537e3e 100644 --- a/cmake-build-debug/Testing/Temporary/LastTest.log +++ b/cmake-build-debug/Testing/Temporary/LastTest.log @@ -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 diff --git a/cmake-build-debug/build.ninja b/cmake-build-debug/build.ninja index 0dd730c..d84967d 100644 --- a/cmake-build-debug/build.ninja +++ b/cmake-build-debug/build.ninja @@ -49,8 +49,8 @@ cmake_ninja_workdir = /Users/tgspock/Documents/GitHub/learn_c_primer.github.io/c build cmake_object_order_depends_target_C_primer: phony || CMakeFiles/C_primer.dir -build CMakeFiles/C_primer.dir/11/11/11.30.c.o: C_COMPILER__C_primer_unscanned_Debug /Users/tgspock/Documents/GitHub/learn_c_primer.github.io/11/11/11.30.c || cmake_object_order_depends_target_C_primer - DEP_FILE = CMakeFiles/C_primer.dir/11/11/11.30.c.o.d +build CMakeFiles/C_primer.dir/11/11/11.34.c.o: C_COMPILER__C_primer_unscanned_Debug /Users/tgspock/Documents/GitHub/learn_c_primer.github.io/11/11/11.34.c || cmake_object_order_depends_target_C_primer + DEP_FILE = CMakeFiles/C_primer.dir/11/11/11.34.c.o.d FLAGS = -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -mmacosx-version-min=12.7 -fcolor-diagnostics INCLUDES = -I/Users/tgspock/Documents/GitHub/learn_c_primer.github.io/9 OBJECT_DIR = CMakeFiles/C_primer.dir @@ -71,7 +71,7 @@ build CMakeFiles/C_primer.dir/11/11/s_gets.c.o: C_COMPILER__C_primer_unscanned_D ############################################# # Link the executable C_primer -build C_primer: C_EXECUTABLE_LINKER__C_primer_Debug CMakeFiles/C_primer.dir/11/11/11.30.c.o CMakeFiles/C_primer.dir/11/11/s_gets.c.o +build C_primer: C_EXECUTABLE_LINKER__C_primer_Debug CMakeFiles/C_primer.dir/11/11/11.34.c.o CMakeFiles/C_primer.dir/11/11/s_gets.c.o FLAGS = -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -mmacosx-version-min=12.7 OBJECT_DIR = CMakeFiles/C_primer.dir POST_BUILD = :