Thread: something wrong with my source code?

  1. #1

    Smile something wrong with my source code?

    #include <stdio.h>

    void main()
    char *message[2]={"Four", "helo"};
    int count, i;

    for(count=0; count<2; count++)
    for(i=0; i<4; i++)
    printf("%s\n", message[count][i]);

    I would like to print the letters one by one( i.e f, o, u, r and h, e, l, o ) in multi-dimensional array but the compiler gave me an error once I compiled it.

    Someone please rectify my errors.

  2. #2
    Registered User
    Join Date
    Oct 2001
    here is your problem...

    >> printf("%s\n", message[count][i]);

    do it this way,

    printf("%c\n", message[count][i]);
    Java ROCKZZZZ....

    Write once, run everywhere!!!!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to make a program that prints it's own source code???
    By chottachatri in forum C++ Programming
    Replies: 38
    Last Post: 03-28-2008, 07:06 PM
  2. Replies: 4
    Last Post: 01-18-2008, 07:05 PM
  3. Documenting Source Code
    By jverkoey in forum A Brief History of
    Replies: 14
    Last Post: 01-04-2008, 12:18 PM
  4. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 04:17 PM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM