Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4612552
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:25:06+00:00 2026-05-22T01:25:06+00:00

class Triangulo: public Figura { public: int x1, y1, x2, y2, x3, y3; void

  • 0
class Triangulo: public Figura
{
    public:
    int x1, y1, x2, y2, x3, y3;
    void dibujar_triangulo()
    {
        cout<<"Se ha dibujado un triangulo color "<<color<<" con coordenadas "<<
        "("<<x1<<","<<y1<<")"<<endl<<"("<<x2<<","<<y2<<")"<<endl<<"("<<x3<<","<<y3<")"<<endl;
    }
};

I’ve got this error:

invalid operands of types 'const char [2]' and '<unresolved overloaded function type>' to binary 'operator<<'

What’s wrong?

Also, Here’s the whole code:

#include <conio.h>
#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;

class Figura
{
    public:
    string color, nombre;
    int num_lados;
    void establecer_color(string param)
    {
        color=param;
    }
    string obtener_color()
    {
        string a;
        cin>>a;
        return a;
    }
    void establecer_lados(int param)
    {
        num_lados=param;
    }
    int obtener_lados()
    {
        int a;
        cin>>a;
        return a;
    }
};

class Circulo: public Figura
{
    public:
    int x, y;
    void dibujar_circulo()
    {
        cout<<"Se ha dibujado un circulo color "<<color<<" con centro en ("<<x<<","<<y<<")"<<endl;
    }
};

class Rectangulo: public Figura
{
    public:
    int x1, y1, x2, y2;
    void dibujar_rectangulo()
    {
        cout<<"Se ha dibujado un rectangulo color "<<color<<" con coordenadas "
        <<"("<<x1<<","<<y1<<")"<<endl<<"("<<x2<<","<<y2<<")"<<endl;
    }
};

class Triangulo: public Figura
{
    public:
    int x1, y1, x2, y2, x3, y3;
    void dibujar_triangulo()
    {
        cout<<"Se ha dibujado un triangulo color "<<color<<" con coordenadas "<<
        "("<<x1<<","<<y1<<")"<<endl<<"("<<x2<<","<<y2<<")"<<endl<<"("<<x3<<","<<y3<")"<<endl;
    }
};

int main()
{
    Circulo Cir;
    Triangulo Tri;
    Rectangulo Rec;
    int i;
    initsw:
    cout<<"Eliga:"<<endl<<"1.\tCirculo"<<endl<<"2.\tRectangulo"
    <<endl<<"3.\tTriangulo"<<endl<<"4.\tSalir"<<endl;
    cin>>i;
    cout<<"Indique el color de su figura"<<endl;
    cin>>Cir.color;
    Tri.color=Cir.color;
    Rec.color=Cir.color;
    switch (i)
    {
        case 1:
        cout<<"Por favor introduzca el centro de su circulo:(x,y)"<<endl;
        scanf("(%d,%d)",&(Cir.x),&(Cir.y));
        Cir.dibujar_circulo();
        break;
        case 2:
        cout<<"Por favor introduzca las coordenadas de su rectangulo:(x1,y1),(x2,y2)"<<endl;
        scanf("(%d,%d),(%d,%d)",&(Rec.x1),&(Rec.y1),&(Rec.x2),&(Rec.y2));
        Rec.dibujar_rectangulo();
        break;
        case 3:
        cout<<"Por favor introduzca las coordenadas de su triangulo:(x1,y1),(x2,y2),(x3,y3)"<<endl;
        scanf("(%d,%d),(%d,%d),(%d,%d)",&(Tri.x1),&(Tri.y1),&(Tri.x2),&(Tri.y2),&(Tri.x3),&(Tri.y3));
        Tri.dibujar_triangulo();
        break;
        case 4:
        goto end;
        break;
        default:
        cout<<"Error, elija otra opcion"<<endl;
        goto initsw;
    }
    end:
    return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T01:25:07+00:00Added an answer on May 22, 2026 at 1:25 am

    It is a typo. You only wrote < before the last ")" in your function. Some things are just easier to spot with properly formatted code:

    void dibujar_triangulo()
    {
        cout << "Se ha dibujado un triangulo color " << color << " con coordenadas "
             << "(" << x1 << "," << y1 << ")" << endl
             << "(" << x2 << "," << y2 << ") "<< endl
             << "(" << x3 << "," << y3 < ")" << endl;
    //                                 ^^ should be <<
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

class X { int i; public: X() { i = 0; } void set(int
class a{ public void foo(int a){ System.out.println(super); } } class b extends a{ public
public class Asterisk { public static void main(String[] args) { String output=""; int count=1,
class Test { public static void main(String[] args) throws Exception { Test t =
import java.util.Scanner; public class DrawTriangle { public static void main(String[] args) { Scanner scan
public class shape { public int x, y; public class triangle { int sides
There is task to implement some triangle class with interface like this public interface
import java.util.Scanner; import java.util.Random; public class DrawTriangle { public static void main(String[] args) {
class Widget; std::vector< std::shared_ptr<Widget> > container class Criterium { public: bool operator()(const Widget& left,
Class 1 private void checkDuplicateCustomer(BulkCustomerVO bulkCustomerVO) { PagedDuplicateCustomerVO duplicateCustomerVO = new PagedDuplicateCustomerVO(); duplicateCustomerVO.setCustomer(bulkCustomerVO.getCustomerVO()); duplicateCustomerVO

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.