?
Solved

called object is not a function

Posted on 2006-07-16
6
Medium Priority
?
3,343 Views
Last Modified: 2008-03-03
Hi I am getting error in the following line....

int m=0;
for(l=0; txt[l] != '\0'; l++)
  {
      if((txt[l] != ' ') && (txt[l] != '\r')  (txt[l] != '\n'))
      {
            str[m]=txt[l];
          m++;
      }
  }
  str[l]='\0';

txt is of type const char *txt
char str[1000];

error message "called object is not a function "


0
Comment
Question by:sudarshantk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 5

Expert Comment

by:dennis_george
ID: 17119702
The following statement in your program is ill-formed....
if((txt[l] != ' ') && (txt[l] != '\r')  (txt[l] != '\n'))

each condition should be separated by a conditional statement....
e.g.
if( (txt[l] != ' ') && ((txt[l] != '\r') || (txt[l] != '\n'))  )

0
 
LVL 14

Expert Comment

by:cwwkie
ID: 17121313
should probably be and instead of or:

if( (txt[l] != ' ') && ((txt[l] != '\r') && (txt[l] != '\n'))  )

otherwise the whole statement would not make much sense.
0
 
LVL 3

Accepted Solution

by:
DineshJolania earned 500 total points
ID: 17239859
Compiler assumes that following syntax is a function
(txt[l] != '\r')  (txt[l] != '\n')   and hence the error.
0
 

Author Comment

by:sudarshantk
ID: 17453386
Thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question