declaration error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jacob Schmidt

    #1

    declaration error

    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 [i] );
    numbchar = sprintf (stringbuf, "%s", msgptr34 [i] );
    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
Working...