#include<ncurses.h>
int printtriangle(int i, int c ,int j);
int main()
{
int c, i, j;
c = 14;
initscr();
printtriangle(i,c,j);
getch();
endwin();
return 0;
}
int printtriangle(int i, int c ,int j)
for(int i=1;i<15;i++)
{
for(int j=(c-i);j<i+1;j++)
{
move(i,j);
printw("*");
}
}
*/ Error messages
triangle.cpp:14:1: error: expected initializer before ‘for’
triangle.cpp:14:13: error: ‘i’ does not name a type
triangle.cpp:14:18: error: ‘i’ does not name a type */
#include<ncurses.h>
int printtriangle(int i, int c ,int j);
int main()
{
int c, i, j;
c = 14;
initscr();
printtriangle(i,c,j);
getch();
endwin();
return 0;
}
int printtriangle(int i, int c ,int j)
//the error is here, this is the beginning of the function printtriangle()
//but where is the body braces { } before starting the "for"
for(int i=1;i<15;i++)
{
for(int j=(c-i);j<i+1;j++)
{
move(i,j);
printw("*");
}
}