error C2664:cannot convert parameter 1 from 'const char [2]' to 'char'

Here is my code so far... i cant figure out why im gettin this error

#include <iostream>
#include <iomanip>
#include <fstream>
#include <cmath>
#include <string>
using namespace std;

void menu();
//void start_grid(char c);
void display_grid();
void plot_a();
void plot_b();
void plot_c();
int selection, i, j;
double x, y;
char grid[21][76];

int main()
{
menu();
cin >> selection;

while (selection > 4)
{
cout << endl << "ERROR! Invalid Choice. Please enter a new selection" << endl;
menu();
cin >> selection;
}

if (selection == 1)
{
cout << endl << "You have selected Plot Function 1" << endl;
plot_a();
system("pause");
system("cls");
menu();
cin >> selection;
}

if (selection == 2)
{
cout << endl << "You have selected Plot Function 2" << endl;
plot_b();
system("pause");
system("cls");
menu();
cin >> selection;
}

if (selection == 3)
{
cout << endl << "You have selected Plot Function 3" << endl;
plot_c();
system("pause");
system("cls");
menu();
cin >> selection;
}
}



void menu()
{
cout << "Math Function Plotter" << endl;
cout << "1. Plot Function 1 /t 3.5*sin<2*pi*t/8 " << endl;
cout << "2. Plot Function 2 /t sqrt(x) " << endl;
cout << "3. Plot Function 3 /t (Ax^2+Bx+C)/(x^2+1)" << endl;
cout << "4. Exit Program " << endl << endl;
cout << "Enter Selection:";
}


void start_grid(char c)
{
for(i=0; i<21; i++)
{
for(j=0;j<76;j++)
grid[i][j] = c;
}
}


void display_grid()
{
system("cls");
cout<<endl;
for(i=20; i>=0; i--)
{
if(i%5==0)
printf("%d ", i/5);
else
printf(" ");
for(j=0; j<76; j++)
printf("%c",grid[i][j]);
printf("\n");
}
printf(" ");
for(i=0; i<=15; i++)
printf("%2d ",i);
}

void plot_a()
{
double x;
system("cls");
start_grid("."); <<<<<<ERROR

for(x=0, i=0; i<76; i++, x+=0.2)
{
y = 3.2*sin(2*3.14159*x/8);
if(y < 0)
continue;
j = (int)( y / 0.20);
grid[j][i] = 'o';
}
display_grid();

cout << endl << endl << endl << "Graph of Plot Function 1\n";
}
I can't check it, but i think there should be:

start_grid('.');
Yes. You want '' around characters. "" means it is a C-style string, which in the case of ".", it ends up being {'.', '\0'} which is a const char[2]
Topic archived. No new replies allowed.