New to C: stumped on error

This is a discussion on New to C: stumped on error within the C Programming forums, part of the General Programming Boards category; Hi I am working on a program and have just one error left that I can not seem to get ...

  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    2

    Question New to C: stumped on error

    Hi I am working on a program and have just one error left that I can not seem to get rid of. Take a look and let me know if you can help. Thanks!

    Code:
    #include "p24fxxxx.h"
    
    
    #define USE_AND_OR
    
    
    #include <uart.h>
    
    
    
    
    #define FCY      4000000
    #define BAUDRATE  9600
    #define BRGVAL   (FCY / BAUDRATE / 32 - 1)
    
    
    char string[] = {'\110', '\145', '\154', '\154', '\157', '\40', '\127',
                           '\157', '\162', '\154', '\144', '\041', '\000'};
    
    
    int main()
    {
    	// Configure UART2 for no interrupts at 9600 baud.
    	OpenUART2(UART_EN, UART_TX_ENABLE, BRGVAL);
    
    
    	// Include a reset of the RX flag as required.
    	IFS1bits.U2RXIF = 0;
    
    
    	putsUART2(unsigned int *string);
    
    
    	while (1);
    
    
    }
    the error is a syntax error "before 'unsigned'" on the second to last line of code

  2. #2
    - - - - - - - - oogabooga's Avatar
    Join Date
    Jan 2008
    Posts
    2,808
    Change this

    putsUART2(unsigned int *string);

    to this

    putsUART2(string);


    And you don't need to specify your string in octal, but could simply do this

    char string[] = "Hello World!";
    The cost of software maintenance increases with the square of the programmer's creativity. - Robert D. Bliss

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 10-19-2011, 07:10 PM
  2. Really Stumped - Help :)
    By brett in forum C Programming
    Replies: 13
    Last Post: 06-13-2007, 05:56 AM
  3. Parse Error that has me stumped
    By readerwhiz in forum C Programming
    Replies: 3
    Last Post: 05-28-2002, 09:32 PM
  4. stumped
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 12-10-2001, 12:27 PM
  5. I am stumped...
    By IGGY in forum C Programming
    Replies: 1
    Last Post: 10-06-2001, 11:15 PM

Tags for this Thread


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