Thread: 2nd scanf input problem.

  1. #16
    Registered User
    Join Date
    Mar 2010
    You can make your main function quite a bit shorter. You have an exact copy of the code inside the loop outside the loop, which you can remove if you make sure the loop always runs at least once.

    But before that, make the improvements std10093 suggested in post 9. Your shift function is implictly returning an int because you haven't specified a return type. You don't return anything though, and dangeous nonsense will ensure if you accidentally call shift in a context where the returned value is used.

  2. #17
    F#ck me Freddy!!
    Join Date
    Sep 2013
    thnx.So after adding void if i call (if function have something to return ) it wil return nothing then?(i ma just asking as to know what void really do).
    And also what is the profit of declaring function before main like std10093 said?(i did that but it does not effected my program).
    Also i dont use return 0 in main function but only this time i had problem with what return 0 actually do and what if i don't use it.(i am a beginner so have a lot of questions )
    thanx again for your reply
    Last edited by coder1; 09-08-2013 at 04:25 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. scanf and int input problem
    By Penage in forum C Programming
    Replies: 5
    Last Post: 04-14-2010, 06:14 AM
  2. input using scanf()
    By kizyle502 in forum C Programming
    Replies: 5
    Last Post: 09-10-2009, 12:56 AM
  3. Input and Scanf
    By DAaaMan64 in forum C Programming
    Replies: 3
    Last Post: 01-14-2009, 06:56 PM
  4. Problem with scanf input
    By ejpjoker in forum C Programming
    Replies: 4
    Last Post: 04-29-2004, 08:28 PM
  5. help with input and scanf
    By kpw in forum C Programming
    Replies: 9
    Last Post: 08-28-2001, 08:21 PM

Tags for this Thread