define and strlen

Posted on 2006-11-09
Last Modified: 2008-03-10
#include <string.h>
#include <stdio.h>
#define IIMAGE "T";
int main(){

What is the problem of this program? I expect the output to be 1 but it keep saying syntax error on the line of printf.
What is the problem and how to correct it?
Question by:william007
LVL 45

Accepted Solution

sunnycoder earned 400 total points
ID: 17912034
Hi william007,

The ; in the #define ...
Remove it

LVL 16

Assisted Solution

PaulCaswell earned 100 total points
ID: 17912854
sunnycoder is right!

After pre-processing this line:


will become:


which is clearly not what you want.


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

Suggested Solutions

Title # Comments Views Activity
How to issue a linefeed, pause, and clear screen in UNIX enviroment 3 77
why "." vs "->" 23 120
Problem to save 10 174
Unable to start eclipse ? 17 161
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 how to create, access, and change arrays in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

679 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