|
|
|
#1 (permalink) | |||||||||||||
|
First Time Build
|
Code:
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
printf("-Fahrenheit to Celsius Converter-\n");
printf("Fahrenheit to convert : ");
int f = scanf_s("%d",f);
int c = (5/9)*(f-32);
printf("%d Degrees in Celsius is %d Degrees\n",f,c);
return 0;
return 0;
}
Quote:
__________________
|
|||||||||||||
|
|
|
|
|
#2 (permalink) | |||||||||||||
|
First Time Build
|
Quote:
__________________
And God said: ∇ • E = ρ / εo; ∇ • B = 0; ∇ x E = - ∂B/∂t; ∇ x B = μoJ + μoεo∂E/∂t; and there was light .
|
|||||||||||||
|
|
|
|
#3 (permalink) | ||||||||||||
|
First Time Build
|
thank you but can you do me a favor and test it out on your C compiler for some reason after i enter my Fahrenheit to convert it stops and gives me an error
Code:
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
int f = 0;
printf("-Fahrenheit to Celsius Converter-n");
printf("Fahrenheit to convert : ");
scanf_s("%d",f);
int c = (5/9)*(f-32);
printf("%d Degrees in Celsius is %d Degreesn",f,c);
return 0;
return 0;
}
__________________
|
||||||||||||
|
|
|
|
|
#4 (permalink) | ||||||||||||
|
First Time Build
|
You have two "return 0;" lines. Delete one.
EDIT: I tried to compile it. I don't have stdafx.h header.
__________________
And God said: ∇ • E = ρ / εo; ∇ • B = 0; ∇ x E = - ∂B/∂t; ∇ x B = μoJ + μoεo∂E/∂t; and there was light .
Last edited by BRISKbaby : 01-09-08 at 01:16 AM. |
||||||||||||
|
|
|
|
#5 (permalink) | ||||||||||||
|
First Time Build
|
wow i really missed that one but for some reason i still get an error
http://img255.imageshack.us/img255/6199/16445673hr4.jpg heres an image to help you understand where im at
__________________
|
||||||||||||
|
|
|
|
|
#6 (permalink) | ||||||||||||
|
Folding Fanatic
|
Quote:
|
||||||||||||
|
|
|
|
#7 (permalink) | |||||||||||||
|
Every base is base 10
|
It should read
Code:
scanf_s("%d",&f);
|
|||||||||||||
|
|
|
|
#8 (permalink) | |||||||||||||
|
Multi-Quote King
|
Hmm... I also don't have that .h file. This is the output I get:
untitled.cpp:1:20: error: stdafx.h: No such file or directory untitled.cpp:4: error: '_TCHAR' has not been declared untitled.cpp: In function 'int _tmain(int, int**)': untitled.cpp:8: error: 'printf' was not declared in this scope untitled.cpp:10: error: 'scanf_s' was not declared in this scope I have no idea what any of this means; I'm an uber noob at programming ![]() I tried compiling this is g++, btw. Edit: wouldn't double quotes in: #include "stdafx.h" make stdaf.h a string? Shouldn't you use < and >? I don't know at all; I'm just using what I know; I'm probably wrong about that.
__________________
"But you would be amazed by how many people think that the only reason to have a computer is to play games, and that playing games is all that anyone with a computer does." - dangerousHobo "Linux is everywhere, it is all around us, even now in this very room. You can see it when you look out your window, or you turn on your television. You can feel it when you go to work, when you go to church, when you pay your taxes. " - mbp"I have used a mac before. And they still don't have right click I mean come on." - aakar Blah, blah, can't hear you
|
|||||||||||||
|
|
|
|
#9 (permalink) | ||||||||||||||
|
Every base is base 10
|
Quote:
As for the edit, the "#" in front of the include indicates that the line is not C++ code, but info for the compiler. In the C++ standard, include files contained in "" are local files. Files in <> are standard c++ library files
|
||||||||||||||
|
|
|
|
#10 (permalink) | |||||||||||||
|
Programmer
|
do you still need help?
__________________
Whats this folding I've been hearing about? Crucial Ballistix Club ![]() Member of the OCN Diablo III Club ~M Hail to the Victors M~
|
|||||||||||||
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|