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

  • Home
  • SEARCH
  • 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 6818387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:10:19+00:00 2026-05-26T21:10:19+00:00

I wanted to post this because I was not really sure what issue I

  • 0

I wanted to post this because I was not really sure what issue I was having with a simple assignment statement. I am doing a homework assignment that asks me to write structs and functions in a simple program to draw out shapes of ASCII characters. Right now I am just trying to test the functions I have written, and I am trying to assign a value to the symbol element of a Circle struct just to test out the DrawShape function I wrote. When I try to assign it a * char, I get an error message saying “error: invalid conversion from ‘const char*’ to ‘char'”. I will put the whole code in, though it is very long and unfinished. Any help with this would be appreciated. The problem I am getting is right in the beginning of the main at “circle1.char = ‘*’ “

#include <iostream>
#include <math.h>
#include <cstdlib>
using namespace std;

const int NUMBER_OF_ROWS = 26;
const int NUMBER_OF_COLUMNS = 81;
char drawSpace[NUMBER_OF_ROWS][NUMBER_OF_COLUMNS];

struct Point{
    int x;
    int y;
};

struct Circle{
    Point center;
    int radius;
    char symbol;
    bool buffer[NUMBER_OF_ROWS][NUMBER_OF_COLUMNS];
};

bool setCircleRadius(Circle &b, int r);
bool setCircleCenter(Circle &b, int x, int y);
bool moveCircle(Circle &b, int x, int y);
void drawCircle (Circle b);
void lineChars(Line a);
void circleChars(Circle b);
void drawShapes();

int main() {
    Circle circle1;
    circle1.radius = 5;
    circle1.symbol = "*";
    circle1.center.x = 40;
    circle1.center.y = 10;

    drawCircle(circle1);

    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-26T21:10:20+00:00Added an answer on May 26, 2026 at 9:10 pm

    You should be using single quotes for characters. Double quotes means you’re using a (potentially single-character) string literal, which is represented as a const char * (pointer to constant character).

    Correct syntax: circle1.symbol = '*';

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This wiki post outlines both a problem and a solution. I wanted to post
I wanted to use groovy for a little ftp script and found this post
This is my first post here and I wanted to get some input from
There may actually not be an answer to this question, but I wanted to
I wanted some of those spiffy rounded corners for a web project that I'm
PSPS: (a Pre-scripted Post-script) It has just come to mind that a more prescient
I saw this post Ruby on Rails - Awesome nested set plugin but I
This is a follow-up question to a different question I asked not too long
I simply want to upload an image to a server with POST. As simple
I wanted to know what various guidelines state about the usage of this. Sometimes

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.