I need to write a c++ program on a quiz with files and static memory allocation. can someone help me..?
This is written to compile on a legacy C compiler like Turbo C or Borland C. You will have to convert so that you could compile with a current C/C++ compiler like Visual C. For example, clrscr, gotoxy like functions are no longer supported in modern compilers. Hope this helps.
Turbo C will work.... Which version of Borland C you use (I'm sure you are not talking about Windows based Borland IDEs like C Builder, etc... You need to use a legacy one... say Borlance C 3.0)
I had a look at your code. Problem is very clear as you are trying to compile a legacy C code (which was developed using either Turbo C or Borland C 3.0-) on a new compiler which is not compatible straight away. You need to change the functions like gotoxy, clrscr to Windows specific functions. For example: gotoxy can be implemented as below. #include <windows.h> void gotoxy(int x, int y){ COORD coord; coord.X = x; coord.Y = y; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_H ANDLE), coord); } Code (markup): If you clear out all those incompatibilities due to legacy C codes in your file, it will get compiled without any problem. When you receive the error list after trying to compile, you can google the first error, fix it and so on. Or else you will have to get a C coder to sort this out for you.
can you please do it for me....I need this very badly in an hour or so..... if you want anything in exchange feel free to ask... please...please
I'm sorry to say that your code is an unprofessionally written code. So you will have to do lots of alignment work, etc... Code is getting compiled now also working at least on the options that I have tried. I have also included Visual C++ project files. When it comes to helping someone who is in trouble, I do not expect anything other than friendship.
thank you very much for your help... I would need the code to run on turbo c++. the file you have attached...could you explain that..? did you change the program codes ? the errors now : while (toupper(an)=='Y') //implicit declaration of function 'int toupper(...)' line-113 id1 = NULL; //converting NULL to non-pointer type line-146 flushall(); //implicit declaration of function 'int flushall(...)' line-175 unlink ("TEMP.DAT"); //implicit declaration of function 'int unlink(...)' line-509 qualify = nrec * (0.75); //assignment of int to double line-1271 fcloseall(); //implicit declaration of function 'int fcloseall(...)' line-1656 Code (markup):
I didn't study functionality wise as it takes more than a day... I just fixed the compiler problems. I didn't change program codes... just commented out incompatible codes and added new line char to some printf.
On Visual C++ 6, this is all okay. However I'm not sure why this "implicit...." error is coming when all these functions are coming from header files that are defined above the routines. Sorry I couldn't help further as I do not have your compiler to reproduce the same error. Please post the Borland compiler you use so someone else from this forum will try to assist you.
while (toupper(an)=='Y') //implicit declaration of function 'int toupper(...)' line-113 id1 = NULL; //converting NULL to non-pointer type line-146 flushall(); //implicit declaration of function 'int flushall(...)' line-175 unlink ("TEMP.DAT"); //implicit declaration of function 'int unlink(...)' line-509 qualify = nrec * (0.75); //assignment of int to double line-1271 fcloseall(); //implicit declaration of function 'int fcloseall(...)' line-1656 Code (markup):
Can you use Dev C++ which is free and let me know what you get. Download link. You must use a standard compiler.