Skip to main content

Thread: Can't Compile


for reason gcc test.c -o 123 isn't making executable file. it'll compile can't ./123 use work , don't know happened. ideas?

okay reason whenever compile program doesn't make executable file don't know what's wrong because working last night.

code i'm trying compile
code:
#include <stdio.h> const double k_ftc = (1.8 * n) + 32; //fahrenheit celsius const double k_ctk = 273.16; //celsius kelvin  void tempature(double n);  int main(void) { 	double f; 	int status; 	printf("hello, let's convert fahrenheit celsius, celsius kelvin!\n"); 	printf("please enter tempature in fahrenheit\n"); 	status = scanf("%lf", &f); 	while (status == 1) 	{ 		tempature(f); 		printf("if continue type in new tempature, or enter q quit.\n"); 		status = scanf("%lf", &f); 	} 	return 0; }  void tempature(double n) { 	printf("%.2lf fahrenheit %.2lf celsius %.2lf kelvin.\n", n, k_ftc, k_ftc + k_ctk); }

code:
main.cpp:2: error: ‘n’ not declared in scope
get rid of errors , should fine.


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Can't Compile


Ubuntu

Comments