I am trying to learn C and am trying to write a program from a c programming class which involves using symbols and colors to draw a picture with loops, _gotoxy, _textcolor, etc... I am supposed to define a prototype horzLine() and then basically print a horizontal line of *. I am running into a problem with how to actually accomplish my task once I have defined the function. I know I need a loop and the gotoxy and printf. However I am not sure how to go about this so that by using the line
horzLine(x,y,length,symbol,color); I get what I want.
The output should look like
**********
The code for what I have done so far is below
#include <stdio.h>
#include <math.h>
#include <conio.h>
#define BLACK 0
#define DARKBLUE 1
#define DARKGREEN 2
#define DARKCYAN 3
#define DARKRED 4
#define DARKMAGENTA 5
#define DARKYELLOW 6
#define DARKWHITE 7
#define GREY 8
#define BLUE 9
#define GREEN 10
#define CYAN 11
#define RED 12
#define MAGENTA 13
#define YELLOW 14
#define WHITE 15
void horzLine(int x, int y, int length, char symbol, int color);
int main(void) {
int i;
int x;
int y;
int length;
char symbol;
int color;
x=5;
y=4;
length=10;
symbol='*';
color=RED;
**not sure how to start the loop**
horzLine(x, y, length, symbol, color);
**what do I need here with my printf**
fflush (stdout);
return 0;
}
horzLine(x,y,length,symbol,color); I get what I want.
The output should look like
**********
The code for what I have done so far is below
#include <stdio.h>
#include <math.h>
#include <conio.h>
#define BLACK 0
#define DARKBLUE 1
#define DARKGREEN 2
#define DARKCYAN 3
#define DARKRED 4
#define DARKMAGENTA 5
#define DARKYELLOW 6
#define DARKWHITE 7
#define GREY 8
#define BLUE 9
#define GREEN 10
#define CYAN 11
#define RED 12
#define MAGENTA 13
#define YELLOW 14
#define WHITE 15
void horzLine(int x, int y, int length, char symbol, int color);
int main(void) {
int i;
int x;
int y;
int length;
char symbol;
int color;
x=5;
y=4;
length=10;
symbol='*';
color=RED;
**not sure how to start the loop**
horzLine(x, y, length, symbol, color);
**what do I need here with my printf**
fflush (stdout);
return 0;
}