LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 10-04-2005, 05:42 AM   #1
Mistro116@yahoo.com
Member
 
Registered: Sep 2005
Posts: 118

Rep: Reputation: 15
Argument 2 - Pointer Error ?? Easy Fix??


So yet another, final question about the xemacs program I wrote:

I wrote this:

void ConvertTemp (void)
{
double celsiusTemperature;

/* Prompts the user to enter a celsius temperature for
conversion into fahrenheit temperature. */
scanf("Enter the celsius temperature : %f\n\n",
celsiusTemperature);

/* Displays the converted celsius temperature in
fahrenheit temperature. */
printf("%f celsius is %f fahrenheit\n",
celsiusTemperature,
CelsiusToFahrenheit(celsiusTemperature));
}


I got this error:

travel.c: In function `ConvertTemp':
travel.c:631: warning: format argument is not a pointer (arg 2)

Why?

Someone got a fix for this?

Thanks,
Mistro116
 
Old 10-04-2005, 08:04 AM   #2
zeropash
Member
 
Registered: Apr 2003
Location: Bangalore,India
Distribution: FC2, RHES, RH9, FC3, FC1, Slackware 3.0
Posts: 208

Rep: Reputation: 30
use
scanf("Enter the celsius temperature : %f\n\n",
&celsiusTemperature);
notice the & before the celciusTemperature.
also for posts please put in the line number so that users can see which line the error is directly without having to go through the full code.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MPlayer -vo Fatal Error - Easy FIX?? Nadinesky Linux - Software 2 08-23-2005 04:56 PM
Function Pointer as an Argument in C trutnev Programming 5 05-24-2005 11:22 AM
passing function pointer as argument worldmagic Programming 7 08-04-2004 04:33 PM
mdk9.2 problems and a easy fix erik Mandriva 10 11-19-2003 12:16 PM
Mouse Problem - SHould be easy to fix! VIP3R Linux - Hardware 2 05-17-2003 06:39 PM


All times are GMT -5. The time now is 03:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration