C++ Problem

Started by destinedjagold August 10th, 2009 6:48 PM
  • 599 views
  • 4 replies

destinedjagold

You can contact me in PC's discord server...

Age 32
Male
Seen 4 Hours Ago
Posted March 24th, 2023
8,579 posts
16 Years
I am having some problems with my C++ at home.
I kinda need to do a project here for me to submit it for my exam but my C++ is starting to be a big pain in the neck...

Anyways, my first problem is that it textcolor as an invalid command line...
Here's my code...
Spoiler:
#include <iostream.h>
#include <conio.h>

int main(void)
{
    int x;

    for(x=1;x<=5;x++){
//        y=x;
        textcolor(x);
        //cout<<"COLOR"<<endl;
        cprintf("COLOR");
        cout<<"\n";
    }
    return 0;
}


I searched around Google and I found that I have a debug problem...
How can I solve this? :\


edit:
I'm using Code::Blocks, btw~

Spinor

&lt;i&gt;&lt;font color=&quot;b1373f&quot;&gt;The Lonely Physicist&lt;/font&gt;&lt;/i&gt;

Age 27
Male
Seen February 13th, 2019
Posted October 4th, 2015
5,175 posts
17.3 Years
#include <iostream.h>
#include <conio.h>

int main(void)
{
    int x;
    int y;

    for(x=1;x<=5;x++){
        y=x;
        textcolor(x);
//        cout<<"COLOR"<<endl;
        cprintf("COLOR");
        cout<<"\n";
    }
    return 0;
}
That is one problem fixed but what exactly is the purpose of the program?

twocows

The not-so-black cat of ill omen

Age 32
Male
Michigan
Seen February 19th, 2023
Posted April 30th, 2021
4,307 posts
14.2 Years
What's this for? You don't seem to be using y at any point. Apart from that, twocows is right, you'll have to look at conio.h and its respective library, especialy if it's one you made yourself
Looks to me like he commented it out.
VNs are superior to anime, don't @ me