Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

called object is not a function

Posted on 2006-07-16
6
Medium Priority
?
3,351 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

610 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