Hello and thanks for taking the time to help me. I am writing a program that prints a dagger-like design to the screen but I keep getting the above error for my program in lines 30 and 34:
#include <iostream>
usingnamespace std;
int display(char ch, int n)
{
for (n=0; ch<n; ch++)
{
cout <<"*";
}
for (ch=0; ch<n+1; ch++)
{
cout <<" " <<endl;
}
return ch;
}
int main ()
{
int target, whitespace, pattern;
cout <<"Enter a whole number for a work of art. ";
cin >>pattern;
whitespace = 0;
target = 1;
while (pattern>0)
for (whitespace=0; target<=10; target++)
{
pattern = display(*, target);
}
for (target=0; target<=10; target--)
{
pattern = display( , target);
}
system("pause");
return 0;
}
After searching through other sites on this problem, it seems a syntax error. I've read the tutorial but it must be something so obvious it's not jumping out at me :P
(yes, I'm quite aware my program is probably wrong for what I want it to do, but I would like to figure that part out for myself, I just learn better that way.)
You may need to enclose you character with ' '. like
'*'. For charatcers, its's just single quotes like: ' <-- that. not: " <-that.
You probably already know that though.