declaration error

Discussion in 'C Programming' started by Jacob Schmidt, Jun 1, 2004.

  1. Could anyone correct the error in my logic here?:

    #include <stdio.h>
    #include <stdlib.h>
    main ()
    {
    const char message1[] = {"\nCurved portion of graph -- D.G.A.C.\
    \n A B C"};
    const char message2[] = {"\nCurved portion of graph -- R.A.C.\
    \n A D E"};
    const char message3[] = {"\nCurved portion of graph -- D.G.A.C.\
    \nA\tB\tC"};
    const char message4[] = {"\nCurved portion of graph R.A.C.\
    \nA\tD\tE"};
    char ( * const msgptr12 [] ) [] = { message1, message2 };
    char ( * const msgptr34 [] ) [] = { message3, message 4};
    /* lint gives a type mismatch error for the previous two lines. */
    char stringbuf [85];

    ...

    printf ( "%s", msgptr12 );
    numbchar = sprintf (stringbuf, "%s", msgptr34 );
    fwrite (stringbuf, numbchar, 1, ofptr);


    Any thoughts or suggestions will be appreciated. L e e _ S h a c k e
    l f o r d @ d o t . c a . g o v
     
    Jacob Schmidt, Jun 1, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Noah
    Replies:
    5
    Views:
    962
  2. Alex Vinokur
    Replies:
    4
    Views:
    595
    Jonathan Turkanis
    Apr 5, 2004
  3. Ovidesvideo
    Replies:
    4
    Views:
    518
    Andrey Tarasevich
    Dec 10, 2004
  4. kelvSYC
    Replies:
    6
    Views:
    7,235
    Richard Herring
    May 17, 2005
  5. Replies:
    4
    Views:
    1,082
    Richard Tobin
    Dec 12, 2006
Loading...

Share This Page