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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:56:24+00:00 2026-06-13T03:56:24+00:00

Guys i need someone fix this problem ? when i compile that code i

  • 0

Guys i need someone fix this problem ? when i compile that code i have this error:

 Error: IntelliSense: expression must have integral or enum type

i have problem in this part:

Console(0, V("seta sv_hostname " + servername + ";\n"));

so how i can fix that

if (strncmp(command, V("exec config_mp"), 14) == 0)
{
    if (GAME_MODE == 'D')
    {
        CIniReader iniReader(V(".\\teknogods.ini"));
        char *servername = iniReader.ReadString(V("Settings"),V("Servername"),"");

        if (strcmp(servername,"") == 0)
        {
            info("Server name set to defult.");
        }
        else
        {
            //Console(0, V("seta scr_teambalance 1;\n"));
            Console(0, V("seta sv_hostname " + servername + ";\n"));
            info("server name set to: %s.", servername);
        }
    }
}
  • 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-13T03:56:25+00:00Added an answer on June 13, 2026 at 3:56 am

    You cannot concatenate two C strings with +.

    In C and C++ string literals are arrays of characters, which when used as rvalue in an expression decay into a pointer to the character. In C (and C++) you can perform pointer arithmetic, which means that you can add or substract an integer (or any integral type) from a pointer and you can also substract two pointers to obtain a difference, but you cannot add two pointers together. The expression "A" + "B" is incorrect as that would try to add two const char*. That is what the compiler is telling you: for the expression "seta sv_hostname " + servername to be correct, servername must be either an integer or an enum.

    If coding C++ you can use std::string, for which there are overloaded operator+ that take either another std::string or const char* and then use the c_str member function to retrieve a const char* to use in interfaces that require C strings.

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

Sidebar

Related Questions

hey there guys and girls i have this code that saves json as a
Hie guys i need help with my code. I have a form where a
Hey guys, I have this great scripts someone on stack overflow helped me out
Hay guys, i need help with a REGEX. I have the got the value
I am new to SVN. Need help from you guys. I have a link
Hello guys i have been using JavaFx scene builder to build a gui that
Can someone please help me with this preg_match if (preg_match('~[^A-Za-z0-9_\./\]~', $filepath)) // Show Error
I need and advice. This is my issue, I have N functions. var FirstOne
I am debugging code someone else wrote that calls a lot of stored procedures
I need someone's help to get me through this. I am working on a

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.