Click here to Skip to main content
15,883,705 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: I couldn't think a good title for this.Simple question Pin
Richard MacCutchan14-Jan-18 21:39
mveRichard MacCutchan14-Jan-18 21:39 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Emrah Duatepe14-Jan-18 21:45
Emrah Duatepe14-Jan-18 21:45 
Questionfinding longest word Pin
Anonygeeker10-Jan-18 22:05
Anonygeeker10-Jan-18 22:05 
AnswerRe: finding longest word Pin
Richard MacCutchan10-Jan-18 22:25
mveRichard MacCutchan10-Jan-18 22:25 
GeneralRe: finding longest word Pin
Anonygeeker10-Jan-18 22:40
Anonygeeker10-Jan-18 22:40 
GeneralRe: finding longest word Pin
Richard MacCutchan10-Jan-18 22:46
mveRichard MacCutchan10-Jan-18 22:46 
GeneralRe: finding longest word Pin
Anonygeeker10-Jan-18 23:00
Anonygeeker10-Jan-18 23:00 
AnswerRe: finding longest word Pin
Jochen Arndt10-Jan-18 22:45
professionalJochen Arndt10-Jan-18 22:45 
It is essential to "see" the code properly indented and formatted. Then you can recognise - besides the problems mentioned by Richard - that there is a missing closing parentheses (which should also issue a compiler error if not present behind the posted code):
void find_long(char *a)
{
    int l,i,l1=0,j=0,l2=0;
    char b[50],c[50];
    l=strlen(a);
    for (i = 0; i < l; i++) {
        if (a[i] != ' ') {
            b[j] = a[i];
            printf("%c ",b[j]);
            j++;
        }
        else if (a[i] == ' ') {
            b[j] = '\0';
            if (strlen(b) > l1) {
                strcpy(c,b);
                l1 = strlen(b);
            // Inserted missing parentheses here
            }
            j = 0;
        }
        else {
            printf("\nEOF");}
        }
    }
    printf("\nlongest is \n");
    printf(c);
// Added missing parentheses here
}

AnswerRe: finding longest word Pin
CPallini10-Jan-18 23:31
mveCPallini10-Jan-18 23:31 
QuestionCString to CByteArray Pin
_Flaviu9-Jan-18 0:16
_Flaviu9-Jan-18 0:16 
AnswerRe: CString to CByteArray Pin
Jochen Arndt9-Jan-18 1:11
professionalJochen Arndt9-Jan-18 1:11 
AnswerRe: CString to CByteArray Pin
Victor Nijegorodov9-Jan-18 1:15
Victor Nijegorodov9-Jan-18 1:15 
AnswerRe: CString to CByteArray Pin
leon de boer9-Jan-18 2:26
leon de boer9-Jan-18 2:26 
GeneralRe: CString to CByteArray Pin
_Flaviu10-Jan-18 0:21
_Flaviu10-Jan-18 0:21 
QuestionMultiThread Question Pin
ForNow8-Jan-18 2:03
ForNow8-Jan-18 2:03 
AnswerRe: MultiThread Question Pin
Jochen Arndt8-Jan-18 2:28
professionalJochen Arndt8-Jan-18 2:28 
GeneralRe: MultiThread Question Pin
ForNow8-Jan-18 2:41
ForNow8-Jan-18 2:41 
GeneralRe: MultiThread Question Pin
Jochen Arndt8-Jan-18 3:00
professionalJochen Arndt8-Jan-18 3:00 
GeneralRe: MultiThread Question Pin
ForNow8-Jan-18 3:03
ForNow8-Jan-18 3:03 
Questionarray and pointer Pin
Anonygeeker7-Jan-18 18:02
Anonygeeker7-Jan-18 18:02 
AnswerRe: array and pointer Pin
Rick York7-Jan-18 18:56
mveRick York7-Jan-18 18:56 
AnswerRe: array and pointer Pin
CPallini7-Jan-18 21:44
mveCPallini7-Jan-18 21:44 
AnswerRe: array and pointer Pin
cao_aba39-Jan-18 15:55
cao_aba39-Jan-18 15:55 
GeneralRe: array and pointer Pin
Richard MacCutchan9-Jan-18 22:26
mveRichard MacCutchan9-Jan-18 22:26 
QuestionWhat am I doing wrong defining single bit? Pin
Vaclav_7-Jan-18 12:36
Vaclav_7-Jan-18 12:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.