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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:10:43+00:00 2026-05-20T14:10:43+00:00

char FramebufferUpdateRequest[11]; uint16_t val; memset(FramebufferUpdateRequest, 0, 10); FramebufferUpdateRequest[0] = 3; FramebufferUpdateRequest[1] = 1; val

  • 0
char FramebufferUpdateRequest[11];
uint16_t val;
memset(FramebufferUpdateRequest, 0, 10);
FramebufferUpdateRequest[0] = 3;
FramebufferUpdateRequest[1] = 1;
val = 3;
memcpy(FramebufferUpdateRequest+6, &val, 2);
val = 2;
memcpy(FramebufferUpdateRequest+8, &val, 2);
FramebufferUpdateRequest[10]='\0';
printf("framerequest :: %c  %s\n", FramebufferUpdateRequest[1], FramebufferUpdateRequest);

output of this printf is Blank i.e “framerequest :: “.Can anyone point out what I am doing wrong?

compiled in gcc 4.1.2

  • 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-20T14:10:44+00:00Added an answer on May 20, 2026 at 2:10 pm

    I think you wanted to write:

    memset(FramebufferUpdateRequest, 0, 10);
    FramebufferUpdateRequest[0] = '3'; //notice the difference
    FramebufferUpdateRequest[1] = '1'; //notice the difference
    val = '3';  //or var = ('3' << 1 | '3') if you want both bytes to have '3'
    memcpy(FramebufferUpdateRequest+6, &val, 2);
    val = '2';  //or var = ('2' << 1 | '2') if you want both bytes to have '2'
    

    Know the difference between '1' and 1:

       cout << (int) ('1') << endl;
       cout << (int) (1) << endl;
    

    Output: ( http://www.ideone.com/z3spn )

    49
    1
    

    Explanation: '1' is a character literal, whose ascii value is 49, whereas 1 is an integer.

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

Sidebar

Related Questions

{ char *a, *b; printf(%lx\n,(b-a)); } Usually works, in fact, I can't imagine it
char label[8] = abcdefgh; char arr[7] = abcdefg; printf(%s\n,label); printf(%s,arr); ====output========== abcdefgh abcdefgÅ Why
char* x = malloc(512); memset(x, 0, 513); free(x); Why is this crashing the program?
char data_[4096]; ... socket_.async_read_some(boost::asio::buffer(data_, 4096), boost::bind(&client::handle_read_header, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); when function handle_read_header is fired,
char i; for(i=0;i<16;i++) printf(%c,asdf[i]); i=1; if(123[i]==1) i=1; if(456[4]==1) i=1; if(789[1]==1) i=1; The output is:
char imei_temp[14] = {0, }; strcpy(imei_temp, 00000000000000); According to my understanding this is valid
char b; operator<<(cout,(operator>>(cin,b))); this is not compiling in vc++ because all 8 overloads cant
char buffer_b[5] = { 0xDA, 0x00, 0x04, 0x00, 0x07 }; printf(%d\n%d\n%d, buffer_b[0], buffer_b[2], buffer_b[4]);
char character = 'c'; string str = null; str = character.ToString();//this is ok char[]
char in[100], *temp[10],var[10][10]; int i, n = 0, double val[10]; var[0][]=ANS; I want to

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.