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 9273989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:14:45+00:00 2026-06-18T16:14:45+00:00

I have a really annoying problem… I have to be able to display some

  • 0

I have a really annoying problem…

I have to be able to display some text from a structure onto an LCD display from micro controller.

These are the affected areas:

struct menu_id {
    char id;
    char menu[11];
    char submenu;
};

void main (void){
    struct menu_id mainmenu[5] = {
    {0, "CHNL1", 1},
{0, "CHNL2", 2},
{0, "Mal Codes", 3},

{1, "CHNL1...", 0},
{2, "CHNL2...", 0},
};

    print(mainmenu[0].id, mainmenu[0].menu);
}

void print (char line1, char line2)
{
    char temp[11];

    LCD_Register_Com();                                                      //Set to Command Register
    OutputChar(LCD_Line0);                                                  //Line 0,0
    LCD_Register_Data();                                                    //Set to Data Register
    sprintf(temp, "%c", line1);
    OutputString(temp);

    LCD_Register_Com();                                                     //Set to Command Register
    OutputChar(LCD_Line1);                                                  //Line 1,0
    LCD_Register_Data();                                                    //Set to Data Register
    sprintf(temp, "%c", line2);
    OutputString(temp);
}

Everytime I try to build the code it throws up this error Main_Test.c:108: warning: illegal conversion of pointer to integer for when I call the print function, “print(mainmenu[0].id, mainmenu[0].menu);”.

Any help would be much appreciated.

Thank you.

  • 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-06-18T16:14:46+00:00Added an answer on June 18, 2026 at 4:14 pm
    void print (char line1, char line2)
    

    change to

    void print (char line1, char* line2)
    

    and

    sprintf(temp, "%c", line2);
    

    to

    sprintf(temp, "%s", line2);
    

    With

    mainmenu[0].menu
    

    You are passing a string not a char to the function.

    struct menu_id {
        char id;
        char menu[11];  <- string
       char submenu;
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, I have another really annoying problem in IE. I am using a
I have a really annoying problem with the Google Play filtering. I have an
have a really annoying time developing some code for a set of UserControls that
i have really annoying problem, i deleted my former acount on heroku with all
At my company we have a really annoying problem with our linker (ld 2.17).
I have recently discovered an annoying problem in some large program i am developing;
I have a really annoying problem with a deployed Grails application on tomcat 7
I have a css/html related problem that's really annoying me :( I have a
I have a really annoying problem. I got this bunch of code which runs
I have a really annoying problem that I tried to solve for a few

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.