Skip to main content
added 229 characters in body
Source Link
hackerrank.c:6:16: error: expected expression string s = get_string(); ^ /data/data/com.termux/files/usr/local/include/cs50.h:109:53: note: expanded from macro 'get_string' ...get_string(NULL, __VA_ARGS__) ^ 1 error generated. 
hackerrank.c:6:16: error: expected expression string s = get_string(); 
hackerrank.c:6:16: error: expected expression string s = get_string(); ^ /data/data/com.termux/files/usr/local/include/cs50.h:109:53: note: expanded from macro 'get_string' ...get_string(NULL, __VA_ARGS__) ^ 1 error generated. 
added 229 characters in body
Source Link
$ cd <unzip_directory>/tests 

realize that the files in tests are using an older CS50 API so

in hackerrank.c needs to be changed from

string s = get_string();

to

string s = get_string("Type here:");

for it to compile correctly. Otherwise you'll get errors like

hackerrank.c:6:16: error: expected expression string s = get_string(); 

So once the edit is made. Compile the code.

$ cc -lcs50 hackerrank.c $ ./a.out MessageType here: <type stuff> hello, <type stuff output> $ 
$ cd <unzip_directory>/tests $ cc -lcs50 hackerrank.c $ ./a.out Message here: <type stuff> hello, <type stuff output> $ 
$ cd <unzip_directory>/tests 

realize that the files in tests are using an older CS50 API so

in hackerrank.c needs to be changed from

string s = get_string();

to

string s = get_string("Type here:");

for it to compile correctly. Otherwise you'll get errors like

hackerrank.c:6:16: error: expected expression string s = get_string(); 

So once the edit is made. Compile the code.

$ cc -lcs50 hackerrank.c $ ./a.out Type here: <type stuff> hello, <type stuff output> $ 
edited body
Source Link
$ ln -s libcs50.so.10.1.0 libcs50.so.10 $ lnls -l .... libcs50.a .... libcs50.so -> libcs50.so.10.1.0 .... libcs50.so.10 -> libcs50.so.10.1.0 .... libcs50.so.10.1.0 
$ ln -s libcs50.so.10.1.0 libcs50.so.10 $ ln -l .... libcs50.a .... libcs50.so -> libcs50.so.10.1.0 .... libcs50.so.10 -> libcs50.so.10.1.0 .... libcs50.so.10.1.0 
$ ln -s libcs50.so.10.1.0 libcs50.so.10 $ ls -l .... libcs50.a .... libcs50.so -> libcs50.so.10.1.0 .... libcs50.so.10 -> libcs50.so.10.1.0 .... libcs50.so.10.1.0 
added 56 characters in body
Source Link
Loading
added 22 characters in body
Source Link
Loading
added 22 characters in body
Source Link
Loading
added 38 characters in body
Source Link
Loading
Source Link
Loading