For my programming class I need to write a program that reads a ground number and a power, calculates, and then prints the answer on screen.
for this program the teacher makes me use pointers and different sub programs for the input output and calculation.
my code is:
Code:
/*Libraries*/#include<stdio.h>#include<conio.h>/*Subprograms*/void input(int *, int *);void To_Decimal(int *, int *, int *);void Output(int,int,int);/*Main program*/int main(){/*variables*/char chAgain = 'y';while(chAgain == 'y'){/*variables*/int nGround = 0, nPower = 0, nDecimal = 1;/*goto subprogram input*/input(&nGround,&nPower);/*check arguments*/if(nGround < 10){/*goto subprogram to decimal*/To_Decimal(&nGround,&nPower,&nDecimal);/*goto subprogram output*/Output(nGround,nPower,nDecimal);}else{printf("\nThe ground number you have entered is 10 or a higher number");}printf("\nDo you want to run the program again? [y/n]: ");chAgain = getche();}return 0;}/*subprogram input*/void input(int *pGround, int *pPower){printf("\nEnter a ground number below 10: ");/*read the ground number*/scanf("%d",pGround);printf("\nEnter a Power: ");/*read the power*/scanf("%d",pPower);}/*subprogram to decimal*/void To_Decimal(int *pGround, int *pPower, int *pDecimal){/*do the math*/int i;for (i = 0; i < *pPower; i++){*pDecimal *= *pGround;}}/*subprogram output*/void Ouput(int nGround, int nPower, int nDecimal){printf("\nThe outcome of the groundnumber: %d and the power: %d is %d",nGround,nPower,nDecimal);}
I'm getting 2 errors when I try to compile.
Code:
error LNK2019: unresolved external symbol "void __cdecl Output(int,int,int)" (?Output@@YAXHHH@Z) referenced in function _main
Code:
Error 5 error LNK1120: 1 unresolved externals
can someone please help me to solve them.
school: Saxion High school
city: Enschede
Country: Netherlands
Name of Professor: Mr. Verbruggen
Course name: Programming 2
Hi all, dummy here.... I have major errors on entering the shell. On login I get:
-bash: dircolors: command not found
-bash: tr: command not found
-bash: fgrep: command not found
-bash: grep: command not found
-bash: grep: command not found
-bash: id: command not found
-bash: [: =: unary... (12 Replies)
hi
i have written a program to display files in a directory
but it doesnt compile on the sun/solaris system....
im using gcc(inbuilt compiler)
im generally used to working on a windows environment so maybe im overlookiing something
ive added comments to help readability of the program
i also... (2 Replies)
I'm trying to set up x2x between my desktop and laptop, and as a precondition to that, I'm just trying to get each to be able to display programs on the other (e.g. "desktop$ xterm -display laptop:0").
OS is Ubuntu 5.10 and X version is X.org 6.8.2
I've set up X to run without -nolisten, and... (1 Reply)
$ errpt | more
IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION
3074FEB7 0802050205 T H fscsi1 ADAPTER ERROR
B8113DD1 0802050205 T H fcs1 LINK ERROR
B8113DD1 0802050205 T H fcs1 LINK ERROR
3074FEB7 0802050205 T H fscsi0 ADAPTER ERROR
B8113DD1 ... (2 Replies)
$ errpt | more
IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION
3074FEB7 0802050205 T H fscsi1 ADAPTER ERROR
B8113DD1 0802050205 T H fcs1 LINK ERROR
B8113DD1 0802050205 T H fcs1 LINK ERROR
3074FEB7 0802050205 T H fscsi0 ADAPTER ERROR
B8113DD1 ... (0 Replies)
fatal server error:
couldn't open x pointer device! is one attached?
xinit: connection refused (errno 239): unable to connect to X server
xinit: no such process (errno3): server error. (1 Reply)