how to remove "function should have a prototype" error?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cksb97
    New Member
    • May 2013
    • 1

    how to remove "function should have a prototype" error?

    Code:
    #include<iostream.h>
    #include<conio.h>
    int main()
    {
    setcolor(BLUE);
    setbkcolor(yellow);
    cout<<"the text in blue colour with yelow background";
    getch();
    return 0;
    }
    it keeps returning the same error always in my turbo c++ compiler if my program is wrong then please say the correct program for changing background colour and text colour plzzzzzzzz
    Last edited by weaknessforcats; May 22 '13, 02:00 PM. Reason: added code tags
  • Nepomuk
    Recognized Expert Specialist
    • Aug 2007
    • 3111

    #2
    Hi cksb97 and welcome to bytes!

    The problem seems to be with the conio.h header; it is not standardized so every compiler maker can create their own one. Not having used the Borland version myself, I can only guess based on what I have found online but try something like
    Code:
    textcolor(COLORS.BLUE);
    textbackground(COLORS.YELLOW);
    rather than your setcolor and setbkcolor functions.
    Last edited by Nepomuk; May 22 '13, 09:53 AM. Reason: Typos

    Comment

    Working...