Hello,
I am trying to do some programming. I'm trying to use C. Half way through a book I gave up trying to learn C++. Now I have C++ but it does take C. I have Borland C++ ver. 4.52. What about the Bloodshed code? It seems to have changed in the past few months. There is nobody there for general questions.
Two questions:
Here's a sample of my code:

Code: C
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <time.h>
#include <dos.h>
/*****************/
void light1 (void);
void r01 ( void );
 
/****************/
 
int main(void) {
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
/* initialize graphics, local variables */
initgraph(&gdriver, &gmode, "");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk)
/* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
}
/***************************************************************/
/* Make a box */
setbkcolor(LIGHTBLUE);
setcolor(6); /* brown */
/* baselin1(); */
setrvlr1();
light1();
sound1();
getch();
 
void r01 ( void ) {
int i = 0;
for (i=1; i<478; i++) {
setcolor (13);
line ( 636, 5 + i, 636, i);
delay(NUMDEL1);
setcolor (11);
line ( 635, i + 1, 635, i + 1);
}
setcolor (13);
}
}
/**************************/

There is code there that you probably don't like. The "request auto detection " and the initgraph stuff. But see the last stuff so lines can be drawn like "line ( 636, 5 + i, 636, i);". I'm drawing lines the old way. Is there a new way without that stuff?

Secondly, I know from some years as tech support, fifteen years ago, that a program "The Mail Order Wizard" could be run in two ways. The people had to be careful about their drive space, not wasting it. The Wizard used to be a DOS program and could be brought up on the C:\ or D:\ or E:\ etc. by Wizard C or D or E, Etc. The program could be written in Assembler or C++.

How do I send that letter in? Can you do it? I would like to know that.

Thank you for your time.

Jim Devaney

Last edited by SaswatPadhi; 9Jul2009 at 06:06.. Reason: Code-block