Thread: Whats wrong with this?

  1. #1
    Registered User
    Join Date
    Sep 2007
    Location
    Boston
    Posts
    25

    Whats wrong with this?

    Code:
    unsigned char line;
    unsigned char column;
    unsigned char line1[20];
    
    if (line = 0) {
    	line1[20] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93};
    	write_lcd(REG, line1[column]);
    error: syntax error before '{' token

    thanks in advance

  2. #2
    Registered User
    Join Date
    Aug 2005
    Location
    Austria
    Posts
    1,990
    Code:
    line1[20] = {0x80 ...
    this is only valid to initialize a variable.
    would work like this
    Code:
    unsigned char line1[20] = {0x80, 0x81, 0x82, 0x83, ...
    BTW
    Code:
    if (line = 0) {
    This is assignement, guess you want to compare

    Kurt

  3. #3
    Registered User
    Join Date
    Sep 2007
    Location
    Boston
    Posts
    25
    thanks you

    builds now

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 07-15-2004, 03:30 PM
  2. Debugging-Looking in the wrong places
    By JaWiB in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 11-03-2003, 10:50 PM
  3. Confused: What is wrong with void??
    By Machewy in forum C++ Programming
    Replies: 19
    Last Post: 04-15-2003, 12:40 PM
  4. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 12:01 PM
  5. Whats wrong?
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 07-14-2002, 01:04 PM