Thread: Loop and Fucntions

  1. #1
    Registered User ankiit's Avatar
    Join Date
    Jan 2012
    Location
    India
    Posts
    16

    Loop and Fucntions

    Hi Mentors,

    I am total newb.

    Can please someday explain the difference between a function and loop, both are used so as not to write the same piece of code again and again.

    kind regards,
    Ankit Gupta

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    What is a function and what is a loop?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    Quote Originally Posted by ankiit View Post
    Hi Mentors,

    I am total newb.

    Can please someday explain the difference between a function and loop, both are used so as not to write the same piece of code again and again.

    kind regards,
    Ankit Gupta
    Please see C Tutorials
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  4. #4
    Registered User ankiit's Avatar
    Join Date
    Jan 2012
    Location
    India
    Posts
    16
    Quote Originally Posted by AndrewHunter View Post
    Please see C Tutorials
    Thanks

  5. #5
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    This comic diagrams a loop. Using the bathroom and partaking of the water fountain might be separate functions.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. strings and fucntions
    By solankill in forum C++ Programming
    Replies: 14
    Last Post: 12-09-2011, 06:10 PM
  2. Replies: 23
    Last Post: 04-05-2011, 03:40 PM
  3. Simple question on creating fucntions
    By live4soccer7 in forum C Programming
    Replies: 22
    Last Post: 02-08-2009, 07:55 PM
  4. for loop ignoring scanf inside loop
    By xIcyx in forum C Programming
    Replies: 2
    Last Post: 04-17-2007, 01:46 AM
  5. declair fucntions before main()?
    By Munkey01 in forum C++ Programming
    Replies: 22
    Last Post: 01-04-2003, 03:38 PM