Results 1 to 6 of 6

Thread: Double "char problem

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    524

    Double "char problem

    I got error :
    error C2440: 'type cast' : cannot convert from 'double' to 'unsigned char *'


    code:
    Code:
    // Guild Alliance Min Players
    bool Alliance ( char * ini )
    {
    	BYTE Alliance;
    	Alliance = GetPrivateProfileInt("Custom","GuildAllianceMinPlayers",20,ini);
    	*(unsigned char*) GS_GUILD_ALLIANCE_MINPLAYERS = Alliance ;
    	return 1;
    }
    //End

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Double "char problem

    Where and how is "GS_GUILD_ALLIANCE_MINPLAYERS" declared?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    524

    Re: Double "char problem

    its in config.h
    and its included in the file but it got errors
    how to fix this error?

  4. #4
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Double "char problem

    Quote Originally Posted by Atheist View Post
    Where and how is "GS_GUILD_ALLIANCE_MINPLAYERS" declared?
    You are apparently trying to cast a double to a char pointer somewhere, which is an invalid typecast.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    524

    Re: Double "char problem

    config.h:
    #define GS_GUILD_ALLIANCE_MINPLAYERS (0046427E+2)

    this is from the info that it gets
    any ideas?

  6. #6
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Double "char problem

    thats a preprocessor definition, not a variable. You can not assign a value to a preprocessor definition.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width