|
From: Schedler, K. <Kur...@hi...> - 2001-04-20 15:05:21
|
It means your function is expecting a pointer to a character (char *) and you are sending it a character (char). A char* holds the address of a character. What you need to do is call your function like this: result(&mychar, myint). The '&' means 'address of'. Either that or change the definition of your function to take a char instead of a char*. "Casting" is forcing a variable of one type to be considered another type. For example, if you had an integer pointer (int*) variable, ptr, you could force it to be seen as a character pointer (char*) by 'casting' it like this: (char *)ptr. Since you were passing a variable to a function that was expecting a different type, the compiler assumed that you had forgotten to cast your variable explicitly to the expected type. -----Original Message----- From: Ruth Aviton [mailto:av...@01...] Sent: Friday, April 20, 2001 9:02 AM To: dev...@li... Subject: [Dev-C++] compileresults hi everybody, I am just a beginner in programming and I have two questions: 1. When I compile a small, simple program i get a compile message as follows. I have no idea what it means and have no idea where to start looking! passing `char' to argument 1 of `result(char *, int)' lacks a cast This happens when i try to call a function. 2. Is there any place where i can get a explanation on what the compiler results mean ? Thank you! Ruth _________________________________________________ IncrediMail - Email has finally evolved - <http://www.incredimail.com/imstampa.html> Click Here "The sender believes that this E-mail and any attachments were free of any virus, worm, Trojan horse, and/or malicious code when sent. This message and its attachments could have been infected during transmission. By reading the message and opening any attachments, the recipient accepts full responsibility for taking protective and remedial action about viruses and other defects. The sender's employer is not liable for any loss or damage arising in any way from this message or its attachments." |