quick hex question

This is a discussion on quick hex question within the C Programming forums, part of the General Programming Boards category; i have a bunch of data coming into my system that is in hex format. to test my program, i ...

  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    108

    quick hex question

    i have a bunch of data coming into my system that is in hex format.

    to test my program, i put in an exact example of an input into the array it will be assigned to but came up with a bunch of errors,

    Code:
    unsigned char Hex_array[BUFFSIZ] =unsigned char Hex_array[BUFFSIZ]= "#RAWWAASFRAMEA,COM1,9,68.0,SATTIME,1263,248186.000,000000000,58e4,1522,22,122,62,563456345dba43623443efdaef3245345fea325345626634623623c000,22*d04567cde";

    errors:

    Code:
    rubbish.cpp
    C:\Documents and Settings\shss.GRUPOGMV\My Documents\C Stuff\decoding\rubbish.cpp(18) : error C2065: 'BUFFSIZ' : undeclared identifier
    C:\Documents and Settings\shss.GRUPOGMV\My Documents\C Stuff\decoding\rubbish.cpp(18) : error C2057: expected constant expression
    C:\Documents and Settings\shss.GRUPOGMV\My Documents\C Stuff\decoding\rubbish.cpp(18) : error C2466: cannot allocate an array of constant size 0
    C:\Documents and Settings\shss.GRUPOGMV\My Documents\C Stuff\decoding\rubbish.cpp(18) : error C2001: newline in constant
    C:\Documents and Settings\shss.GRUPOGMV\My Documents\C Stuff\decoding\rubbish.cpp(19) : error C2143: syntax error : missing ';' before 'constant'
    C:\Documents and Settings\shss.GRUPOGMV\My Documents\C Stuff\decoding\rubbish.cpp(19) : error C2059: syntax error : 'bad suffix on number'
    C:\Documents and Settings\shss.GRUPOGMV\My Documents\C Stuff\decoding\rubbish.cpp(20) : error C2059: syntax error : 'bad suffix on number'
    C:\Documents and Settings\shss.GRUPOGMV\My Documents\C Stuff\decoding\rubbish.cpp(20) : error C2146: syntax error : missing ';' before identifier 'dba43623443efdaef3245345fea3253'
    C:\Documents and Settings\shss.GRUPOGMV\My Documents\C Stuff\decoding\rubbish.cpp(20) : error C2065: 'dba43623443efdaef3245345fea3253' : undeclared identifier
    C:\Documents and Settings\shss.GRUPOGMV\My Documents\C Stuff\decoding\rubbish.cpp(20) : error C2143: syntax error : missing ';' before 'constant'
    C:\Documents and Settings\shss.GRUPOGMV\My Documents\C Stuff\decoding\rubbish.cpp(20) : error C2146: syntax error : missing ';' before identifier 'c000'
    C:\Documents and Settings\shss.GRUPOGMV\My Documents\C Stuff\decoding\rubbish.cpp(20) : error C2065: 'c000' : undeclared identifier
    C:\Documents and Settings\shss.GRUPOGMV\My Documents\C Stuff\decoding\rubbish.cpp(20) : error C2001: newline in constant
    C:\Documents and Settings\shss.GRUPOGMV\My Documents\C Stuff\decoding\rubbish.cpp(20) : error C2065: 'd04567cde' : undeclared identifier
    C:\Documents and Settings\shss.GRUPOGMV\My Documents\C Stuff\decoding\rubbish.cpp(20) : error C2143: syntax error : missing ';' before 'string'
    C:\Documents and Settings\shss.GRUPOGMV\My Documents\C Stuff\decoding\rubbish.cpp(21) : error C2144: syntax error : missing ';' before type 'char'
    C:\Documents and Settings\shss.GRUPOGMV\My Documents\C Stuff\decoding\rubbish.cpp(25) : error C2065: 'uncoded' : undeclared identifier
    C:\Documents and Settings\shss.GRUPOGMV\My Documents\C Stuff\decoding\rubbish.cpp(27) : error C2440: '=' : cannot convert from 'char *' to 'int'
            This conversion requires a reinterpret_cast, a C-style cast or function-style cast
    Error executing cl.exe.
    
    rubbish.exe - 18 error(s), 0 warning(s)
    its probably an easy answer but i couldnt find it....

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Take off everything to the left of the first equal sign, including it. Also, it's BUFSIZ, with only one F.


    Quzah.
    Last edited by quzah; 06-29-2005 at 03:39 AM.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    108
    thank you very much !!

    cant believe it was so simple. i

  4. #4
    ---
    Join Date
    May 2004
    Posts
    1,379
    lol so simple? what exactly were you trying to do??

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. very quick question.
    By Unregistered in forum C++ Programming
    Replies: 7
    Last Post: 07-24-2002, 03:48 AM
  2. quick question
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 07-22-2002, 04:44 AM
  3. Quick Question Regarding Pointers
    By charash in forum C++ Programming
    Replies: 4
    Last Post: 05-04-2002, 11:04 AM
  4. * quick question *
    By SavesTheDay in forum C Programming
    Replies: 3
    Last Post: 03-27-2002, 05:58 PM
  5. Quick question: exit();
    By Cheeze-It in forum C Programming
    Replies: 6
    Last Post: 08-15-2001, 05:46 PM

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