illegal character, unknown preprocessor directive 'i'

i have to make a program that asks the user to input the psi pressure and have an output based on the input value. i thought i had it f/3igu5-red out but i keep getting the error.

Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
pressure.cpp:
Error E2206 pressure.cpp 1: Illegal character ' ' (0xff)
Error E2206 pressure.cpp 1: Illegal character '■' (0xfe)
Error E2206 pressure.cpp 1: Illegal character '#' (0x23)
Error E2206 pressure.cpp 1: Illegal character '' (0x0)
Error E2206 pressure.cpp 1: Illegal character '' (0x0)
Error E2206 pressure.cpp 1: Illegal character '' (0x0)
Error E2141 pressure.cpp 1: Declaration syntax error
Error E2206 pressure.cpp 1: Illegal character '' (0x0)
Error E2206 pressure.cpp 1: Illegal character '' (0x0)
Error E2206 pressure.cpp 1: Illegal character '' (0x0)
Error E2206 pressure.cpp 1: Illegal character '' (0x0)
Error E2206 pressure.cpp 1: Illegal character '' (0x0)
Error E2206 pressure.cpp 1: Illegal character '' (0x0)
Error E2206 pressure.cpp 1: Illegal character '' (0x0)
Error E2206 pressure.cpp 1: Illegal character '' (0x0)
Error E2206 pressure.cpp 1: Illegal character '' (0x0)
Error E2206 pressure.cpp 1: Illegal character '' (0x0)
Error E2206 pressure.cpp 1: Illegal character '' (0x0)
Error E2206 pressure.cpp 1: Illegal character '' (0x0)
Error E2206 pressure.cpp 1: Illegal character '' (0x0)
Error E2206 pressure.cpp 1: Illegal character '' (0x0)
Error E2206 pressure.cpp 1: Illegal character '' (0x0)
Error E2206 pressure.cpp 1: Illegal character '' (0x0)
Error E2048 pressure.cpp 3: Unknown preprocessor directive: 'i'
Error E2206 pressure.cpp 5: Illegal character '' (0x0)
Error E2228 pressure.cpp 5: Too many error or warning messages
*** 26 errors in Compile ***


here is my code. any help would be greatly appreciated. thank you.

# include <stdio.h>
# include <math.h>
int main(void)
{
double psi;
input(&psi);
printf("Enter the line pressure in psi: ");
scanf("%lf",&psi);
if((psi>= 50) && (psi <=80))
{
printf("\nLine pressure is %f psi.\n"
"Line pressure normal, from 50 to 100 psi.\n"
"System startup in effect", psi);
}
else if((psi>0)&& (psi<50))
{
printf("\nSystem startup cancelled.\n"
"\nLine pressure is %f psi.\n"
"\nLine pressure must be from 50 to 100 psi.",psi);
}
else if((psi>80))
{
printf("\nSystem startup cancelled.\n"
"Line pressure is %f psi.\n"
"Line pressure must be from 50 to 100 psi.",psi);
{
else
{
printf("\nSystem failure - no line pressure.\n"
"Line pressure %c 0 psi.\n"
"Line pressure must be from 50 to 100 psi.",243);
}
return(0);
}

thanks again for any help
1
2
3
4
//What are you trying to do here...? This is not right.
printf("\nLine pressure is %f psi.\n"
"Line pressure normal, from 50 to 100 psi.\n"
"System startup in effect", psi);
if the pressure is between 50 and 100 the program says:
"Line pressure is 'the value of the psi' psi.
Line pressure normal, from 50 to 100 psi.
System startup in effect."

if it's less than or equal to zero :
"System failure - no line pressure.
Line pressure 'need to make it so the program outputs the less than or equal to sign' 0 psi
Line pressure must be from 50 to 100 psi."

i also need help making it output that symbol. i use the %c notation right?

thanks again
printf("Hello, " "world!\n"); //Do you see the problem yet?
^That's actually legal; the compiler automatically concatenates adjacent string literals for you.
It looks like as if you saved pressure.cpp as unicode and the Borland c++ compiler doesn't understand it
thank you coder777. but now i have this when i compile it.

E:\jat>bcc32 pressure
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
pressure.cpp:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external 'input()' referenced from E:\JAT\PRESSURE.OBJ
Error: Unresolved external 'input()' referenced from E:\JAT\PRESSURE.OBJ


input(&psi);
You're trying to use the function named input, but the linker cannot find any such function
@firedraco: Wow! To think that something like that slipped through... That's what I get for learning Java first...
Topic archived. No new replies allowed.