converting char to char???

This is a discussion on converting char to char??? within the C Programming forums, part of the General Programming Boards category; i have an error in my program that says : cannot convert 'char' to char*' in function main() i have ...

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    2

    Question converting char to char???

    i have an error in my program that says :
    cannot convert 'char' to char*' in function main()
    i have went over it and cannot find the problem... does anyone know?

  2. #2
    Registered User datainjector's Avatar
    Join Date
    Mar 2002
    Posts
    356
    might be u are trying to put in a string array in a char varaible ....are you using functions might be u are passing wrong stuff ..post ur code that will help us to find the problem
    "I wish i could wish my wishs away"

    "By indirections find directions out" -- William Shakespears

    "Do what thou wilt shall be the whole of the law" -- Crowley "THE BEAST 666"

    Mizra -> love = Death...
    RDB(Rocks yooo)..

    http://www.cbeginnersunited.com

    Are you ready for the Trix ???

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Compilers normally give you line number to go with the error messages..... that'll be a good place to start.

    char is a single char (byte)
    char* is a pointer to a char.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  4. #4
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    char and char* are completely different types. I know it's confusing to understand at first, but that is how it works. Whenyou add a * to a type, it is like the differenec between int and char.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 12
    Last Post: 08-11-2008, 11:02 PM
  2. Obtaining source & destination IP,details of ICMP Header & each of field of it ???
    By cromologic in forum Networking/Device Communication
    Replies: 1
    Last Post: 04-29-2006, 02:49 PM
  3. Replies: 6
    Last Post: 06-30-2005, 08:03 AM
  4. Program Crashing
    By Pressure in forum C Programming
    Replies: 3
    Last Post: 04-18-2005, 10:28 PM
  5. comparing fields in a text file
    By darfader in forum C Programming
    Replies: 9
    Last Post: 08-22-2003, 08:21 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21