Thread: nob question super easy

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    62

    nob question super easy

    why is this code no working i need help plz. Also, how does this code work
    Code:
    #include<stdio.h>
    #include<conio.h>
    
    
    int main ( )
    {
        
         printf("&#37;-10s something\n%-10s else\n", "one", "two");
         getch();
    }

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by joker_tony View Post
    why is this code no working i need help plz. Also, how does this code work
    You can't have both -- either it doesn't work, or we can tell you how it does work, but not both. Let's try this: what do you want, and what do you get?

  3. #3
    Registered User
    Join Date
    Feb 2008
    Posts
    62
    it should print out the above, and i dont understand how this works because somebody posted this on my thread and i dont get it
    Code:
    prints
    
    Code:
    one        something
    two        else

  4. #4
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by joker_tony View Post
    it should print out the above, and i dont understand how this works because somebody posted this on my thread and i dont get it
    Code:
    prints
    
    Code:
    one        something
    two        else
    It does print the above. "%-10s" is just a format specifier: %s means string, 10 means "use at least 10 positions to print the string", and - means "start at the left".

  5. #5
    Registered User
    Join Date
    Feb 2008
    Posts
    62
    its strange the first time i compile the program it didnt work

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. This is hopefully an extremely easy question...
    By rachaelvictoria in forum C Programming
    Replies: 2
    Last Post: 11-07-2005, 01:36 AM
  2. 4 easy question
    By Zeratulsdomain in forum C++ Programming
    Replies: 2
    Last Post: 10-15-2005, 10:43 PM
  3. Easy Question
    By Bryan in forum C++ Programming
    Replies: 15
    Last Post: 10-17-2002, 04:25 PM
  4. Easy Question
    By inandout in forum C++ Programming
    Replies: 3
    Last Post: 10-17-2002, 05:49 AM
  5. Easy Question
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 08-12-2002, 12:19 PM