Note that there are some explanatory texts on larger screens.

plurals
  1. POConverting static array to char* and managing the type conversion
    primarykey
    data
    text
    <p>Previously I took static array like : <code>char ch[20]</code>. but I changed this style bcoz may it need to be >20. So I declared it as <code>char *ch;</code> While I ported my code it look like below with given prices.</p> <pre><code>char *word; char *ch; char *excluded_string; char *skp; std::string result_string; std::string rcv; i=0,j=0; do { bytesReceived = recv(*csock, buffer.data(), buffer.size(), 0); if ( bytesReceived == -1 ) { fprintf(stderr, "Error receiving data %d \n", errno); goto FINISH; } else rcv.append( buffer.cbegin(), buffer.cend() ); 182: } while ( bytesReceived == MAX_BUF_LENGTH ) 184: **word = strtok(&amp; rcv[0]," "); 185: while (word!= NULL) { 6 skp = BoyerMoore_skip(word, strlen(word) ); //Booyes moore is string search algo 9 if(skp != NULL) 0 { 201 i++; 2 continue; 3 } 4 bfr &lt;&lt; excluded_string[j] &lt;&lt; " "; 5 result_string = bfr.str(); 6 j++; 7 }** </code></pre> <p>Error: </p> <pre><code>daemon.cpp:184:8: error: expected ‘;’ before ‘word’ daemon.cpp:188:29: error: invalid conversion from ‘char*’ to ‘char’ [-fpermissive] daemon.cpp:189:41: error: invalid conversion from ‘char*’ to ‘char’ [-fpermissive] daemon.cpp:190:51: error: invalid conversion from ‘char’ to ‘const char*’ [-fpermissive] In file included from daemon.cpp:2:0: /usr/include/string.h:395:15: error: initializing argument 1 of ‘size_t strlen(const char*)’ [-fpermissive] daemon.cpp:190:53: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive] In file included from daemon.cpp:36:0: dictionary_exclude.h:4:14: error: initializing argument 1 of ‘char* BoyerMoore_skip(char*, int)’ [-fpermissive] </code></pre> <p>How to remove these error?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload