Confused by CHAR

This is a discussion on Confused by CHAR within the C++ Programming forums, part of the General Programming Boards category; I saw in a code the datatype CHAR (with uppercase). I checked on MSDN and it says "A string function ...

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    856

    Confused by CHAR

    I saw in a code the datatype CHAR (with uppercase).

    I checked on MSDN and it says
    "A string function that converts an int ASCII code to a character."

    PHP Code:
    http://msdn.microsoft.com/en-us/library/aa258239(SQL.80).aspx 

    Code:
    CHAR* m_cCompleteBuffer = new CHAR [2096];
    So how can it be a data type and a function at the same time?
    Or is it the same as char (with lowercase)?
    Last edited by Ducky; 04-13-2009 at 08:53 AM.
    Compiler MSVC++ 2013 with Code::Blocks.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    23,820
    You are looking at a reference for SQL, not C++.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    856
    Yes, sorry.

    But i cant find anything on C++ either.
    Compiler MSVC++ 2013 with Code::Blocks.

  4. #4
    "I Win!" by U. Lose vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,754
    To be or not to be == true

  5. #5
    i've lost my mind
    Join Date
    Jun 2008
    Posts
    26
    You can't find anything about the data type 'char'?

    c++ char - Google Search
    Last edited by gltiich; 04-13-2009 at 09:25 AM.

  6. #6
    Registered User
    Join Date
    Dec 2007
    Posts
    856
    Thank you Vart, thats it.

    typedef char CHAR;

    So it looks like its the same as "char" only to use it in Windows Visual.
    Compiler MSVC++ 2013 with Code::Blocks.

  7. #7
    Registered User
    Join Date
    Dec 2007
    Posts
    856
    To Gltiich.

    I wasn't talking about the data type 'char'.

    I know the data type 'char' all too well.
    Compiler MSVC++ 2013 with Code::Blocks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Conversion Char To Char * Problem
    By ltanusaputra in forum Windows Programming
    Replies: 3
    Last Post: 03-01-2008, 01:06 PM
  2. Replies: 16
    Last Post: 10-29-2006, 04:04 AM
  3. newbie needs help with code
    By compudude86 in forum C Programming
    Replies: 6
    Last Post: 07-23-2006, 08:54 PM
  4. String sorthing, file opening and saving.
    By j0hnb in forum C Programming
    Replies: 9
    Last Post: 01-23-2003, 12:18 AM
  5. Extra printed stmts...why?
    By mangoz in forum C Programming
    Replies: 4
    Last Post: 12-19-2001, 06:56 AM

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