Compilation Error otherBinarySearch #11

Closed
opened 2026-01-29 15:00:32 +00:00 by claunia · 2 comments
Owner

Originally created by @ankitrgadiya on GitHub (Sep 29, 2017).

gcc -Wall -Werror otherBinarySearch.c -o otherBinarySearch
otherBinarySearch.c:3:13: error: expected ‘;’, ‘,’ or ‘)’ before numeric constant
 #define len 5
             ^
otherBinarySearch.c:5:36: note: in expansion of macro ‘len’
 int binarySearch(int array[] , int len , int searchX)
                                    ^~~

This is because pre-processor is replacing len with 5 in the function prototype.
https://stackoverflow.com/a/7103183

Originally created by @ankitrgadiya on GitHub (Sep 29, 2017). ``` gcc -Wall -Werror otherBinarySearch.c -o otherBinarySearch otherBinarySearch.c:3:13: error: expected ‘;’, ‘,’ or ‘)’ before numeric constant #define len 5 ^ otherBinarySearch.c:5:36: note: in expansion of macro ‘len’ int binarySearch(int array[] , int len , int searchX) ^~~ ``` This is because pre-processor is replacing `len` with 5 in the function prototype. https://stackoverflow.com/a/7103183
Author
Owner

@koseokkyu commented on GitHub (Dec 4, 2017):

The compilation error of otherbinarysearch was modified in #103 with logic error.

@koseokkyu commented on GitHub (Dec 4, 2017): The compilation error of otherbinarysearch was modified in #103 with logic error.
Author
Owner

@SUBHAROOP commented on GitHub (Jan 1, 2018):

i want to work on this and try to fix this

@SUBHAROOP commented on GitHub (Jan 1, 2018): i want to work on this and try to fix this
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#11