Skip to content

Commit

Permalink
update 01-producing-libriaries code example
Browse files Browse the repository at this point in the history
  • Loading branch information
code4yonglei committed Oct 1, 2024
1 parent 31ac143 commit 786abbc
Show file tree
Hide file tree
Showing 17 changed files with 11 additions and 11 deletions.
Binary file removed content/code/00_hello-world/.DS_Store
Binary file not shown.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#include <iostream>

int main() {
Message say_hello("Hello, CMake World!");
Message say_hello("Hello, CMake World from C++!");

std::cout << say_hello << std::endl;

Message say_goodbye("Goodbye, CMake World");
Message say_goodbye("Goodbye, CMake World from C++!");

std::cout << say_goodbye << std::endl;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#include <iostream>

int main() {
Message say_hello("Hello, CMake World!");
Message say_hello("Hello, CMake World from C++!");

std::cout << say_hello << std::endl;

Message say_goodbye("Goodbye, CMake World");
Message say_goodbye("Goodbye, CMake World from C++!");

std::cout << say_goodbye << std::endl;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ program hello_world

type(Messenger) :: hello, bye

hello%message_ = 'Hello, CMake world!'
hello%message_ = 'Hello, CMake world from Fortran!'
print *, print_message(hello)

bye%message_ = 'Bye, CMake world!'
bye%message_ = 'Bye, CMake world from Fortran!'
print *, print_message(bye)

end program
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module messaging
pure function print_message(postman) result(m)

type(Messenger), intent(in) :: postman
character(len=19) :: m
character(len=32) :: m

m = postman%message_

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ program hello_world

type(Messenger) :: hello, bye

hello%message_ = 'Hello, CMake world!'
hello%message_ = 'Hello, CMake world from Fortran!'
print *, print_message(hello)

bye%message_ = 'Bye, CMake world!'
bye%message_ = 'Bye, CMake world from Fortran!'
print *, print_message(bye)

end program
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module messaging

public Messenger
type Messenger
character(len=19) :: message_
character(len=32) :: message_
end type

public print_message
Expand All @@ -16,7 +16,7 @@ module messaging
pure function print_message(postman) result(m)

type(Messenger), intent(in) :: postman
character(len=19) :: m
character(len=32) :: m

m = postman%message_

Expand Down
Binary file not shown.

0 comments on commit 786abbc

Please sign in to comment.