Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e3c45f9

Browse files
committed
Exercise 27.9 (fixed)
1 parent 7e124fb commit e3c45f9

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

‎Chapter_27/C27_Exercise_27.9.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ bool AddWordToLinkedList(struct List* lst, char* word)
351351
return true;
352352
}
353353

354-
int CompareWords(const void** word1, const void** word2)
354+
int CompareWords(const void* word1, const void* word2)
355355
{
356-
return strcmp(*((char**)word1), *((char**)word2));
356+
return strcmp(*((constchar**)word1), *((constchar**)word2));
357357
}

‎Chapter_27/C27_Exercise_27.9.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ bool GetString(char* string, size_t size);
5555
bool Extend(Word* w, size_t newSize);
5656
bool AddWord(Word* w, char* word);
5757
bool AddWordToLinkedList(struct List* lst, char* word);
58-
int CompareWords(const void** word1, const void** word2);
58+
int CompareWords(const void* word1, const void* word2);
5959

6060
#endif

‎Chapter_27/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set (CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR}/..)
1111

1212
# set 'COMPILE_AS_C' to 'true' to compile all exercises as C sources
1313
# this only works with Microsoft C/C++ Compiler
14-
set (COMPILE_AS_C true)
14+
set (COMPILE_AS_C false)
1515

1616
set (FILE_NAME C27_Exercise_27.1)
1717
set (SOURCE_CXX_LIST ${FILE_NAME}.cpp)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /