-
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
16c8512
commit 4c3665f
Showing
15 changed files
with
69 additions
and
17 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include <stdio.h> | ||
void copy_arr (double ar[], const double m[], int n); | ||
void copy_ptr (double * str, const double * q, int n); | ||
void copy_ptrs (double ar[], const double * m, const double * p); | ||
int main (void) | ||
{ | ||
int n; | ||
double source[5] = {1.1, 2.2, 3.3, 4.4, 5.5}; | ||
double target[5]; | ||
double target2[5]; | ||
double target3[5]; | ||
|
||
copy_arr (target, source, 5); | ||
copy_ptr (target2, source, 5); | ||
copy_ptrs (target3, source, source + 5); | ||
for (n = 0; n < 5; n ++) | ||
{ | ||
printf ("source[%d] = %g, target[%d] = %g, target2[%d] = %g, target3[%d] = %g\n", n, source[n], n, | ||
target[n], n, target2[n], n, target3[n]); | ||
} | ||
|
||
return 0; | ||
} | ||
void copy_arr (double ar[], const double m[], int n) | ||
{ | ||
for (int i = 0; i < n; i ++) | ||
{ | ||
ar[i] = m[i]; | ||
} | ||
} | ||
void copy_ptr (double * str, const double * q, int n) | ||
{ | ||
for (int i = 0; i < n; i ++) | ||
{ | ||
*str = *q; | ||
str ++; | ||
q ++; | ||
} | ||
} | ||
void copy_ptrs (double ar[], const double * m, const double * p) | ||
{ | ||
for (; m < p; m ++, ar ++) | ||
{ | ||
*ar = *m; | ||
} | ||
} |
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,5 @@ | ||
#include <stdio.h> | ||
int main (void) | ||
{ | ||
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 |
---|---|---|
|
@@ -6,5 +6,5 @@ set(CMAKE_CXX_STANDARD 14) | |
include_directories(9) | ||
|
||
add_executable(C_primer | ||
10_plus/10.23.c | ||
10_plus/10.25.c | ||
) |
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,12 +1,13 @@ | ||
# ninja log v5 | ||
433 1450 1702958014858365474 C_primer d7434207347cad4d | ||
127 324 1703162059321104859 C_primer 3d9b417299e9a684 | ||
4 335 1702822896367170007 CMakeFiles/C_primer.dir/9_plus/9_plus/9.36.c.o 9f95dd8b31879556 | ||
1 144 1702825381558358062 CMakeFiles/C_primer.dir/10_plus/10.14.c.o 27c11ea85739635 | ||
0 267 1702717481449984888 CMakeFiles/C_primer.dir/10_plus/10.12.c.o d0b2887c66daa4b1 | ||
0 431 1702958013825178426 CMakeFiles/C_primer.dir/10_plus/10.15.c.o 3cd52d55636f54b | ||
0 305 1702822896335875576 CMakeFiles/C_primer.dir/9_plus/9_plus/9.35.c.o c09ce47479a5514a | ||
1 138 1702825381555261318 CMakeFiles/C_primer.dir/10_plus/10.13.c.o 7bef308e0e43b8ac | ||
0 399 1703062779349976926 CMakeFiles/C_primer.dir/10_plus/10.23.c.o 4a833a773a8f433a | ||
403 1098 1703062780055927389 C_primer 81b0a4dcc53c9b5b | ||
1 268 1703062788743730179 CMakeFiles/C_primer.dir/10_plus/10.23.c.o 4a833a773a8f433a | ||
268 702 1703062789201748673 C_primer 81b0a4dcc53c9b5b | ||
5 125 1703162059120010468 CMakeFiles/C_primer.dir/10_plus/10.25.c.o df8f1239080514a | ||
1 835 1703211439493572028 CMakeFiles/C_primer.dir/10_plus/10.25.c.o df8f1239080514a | ||
836 1468 1703211440131161055 C_primer 3d9b417299e9a684 | ||
2 620 1703211568893536340 CMakeFiles/C_primer.dir/10_plus/10.25.c.o df8f1239080514a | ||
621 729 1703211569006352175 C_primer 3d9b417299e9a684 |
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.3s) | ||
-- Configuring done (0.1s) | ||
-- 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: Dec 20 16:59 CST | ||
Start testing: Dec 22 10:19 CST | ||
---------------------------------------------------------- | ||
End testing: Dec 20 16:59 CST | ||
End testing: Dec 22 10:19 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