Hi all,
I have a program that I'm trying to write. I get an error that I don't know how to correct. Can anyone tell me where my error is? I'm using Borland 4.5 and the error states "cannot covert char* to char in sales function().
This is the portion of the program and the error comes up on the line....trans_descript[trans_count]=descript
This may be an easy error for most of you out there, however, I can't spot it because I'm new to programming. Thanks, M
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
//#define MAX 50
//#define MAX1 5
float bal=30000;
char trans_type[50];
float trans_amount[50];
char trans_descript[50];
float cur_bal[50];
int trans_count=0;
char type;
char descript[50];
float amount;
void sales(void){
//printf("\nThis is Sales.\n\n");
printf("\nEnter transaction amount: ");
scanf("%f",&amount);
fflush(stdin);
printf("\nEnter transaction decription: ");
gets(descript);
fflush(stdin);
type='S';
bal=bal-amount;
trans_amount[trans_count]=amount;
trans_descript[trans_count]=descript; <--here is where it is
trans_type[trans_count]=type;
cur_bal[trans_count]=bal;
trans_count +=1;
}