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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:23:40+00:00 2026-06-10T09:23:40+00:00

i have defined a value using #define username admin then i want to use

  • 0

i have defined a value using

#define username "admin"

then i want to use the username in a char statement into sql as

const char *pSQL[1];
pSQL[1] = "update websrv_config set admin_id='" + username + "'";

but it seems that there is an error

error: invalid operands of types ‘const char [36]’ and ‘const char [6]’ to binary ‘operator+’

how can i overcome it?

  • 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-10T09:23:41+00:00Added an answer on June 10, 2026 at 9:23 am

    Try this:

    pSQL[0] = "update websrv_config set admin_id='"  username  "'";
    

    In c++ array index starts with 0 so when you have decleared an array of length 1. The only index it can have is 0. Further, ‘+’ is not used for concatenation in c++.

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

Sidebar

Related Questions

i have defined a value using extern char WEBSRV_ADMIN_ID[31]; char WEBSRV_ADMIN_ID[31]= admin; then i
I have a small sample function: #define VALUE 0 int test(unsigned char x) {
I have defined a ConfigurationProperty class, which is basicly a key-value pair (with key
I have been trying to assign value to an object array that is defined
I have a file that defines constant variables, like this: define_vars.php <? define(something,value); define(something1,value);
Running into a problem. I have a table defined to hold the values of
I have just moved one of my projects into VS2010/fx4.0 and am using a
Hello I have a problem to retrieve a value from a method. I'm using
I have three tables to define users: USER: user_id (int), username (varchar) USER_METADATA_FIELD: user_metadata_field_id
i have a script handlebar.. <script id=ownerItem data-template-name='ownerItem' type=text/x-handlebars> {{value.UserName}} &nbsp;<button {{action remove on=click}}>Remove</button>

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.