Thread: c in real world

  1. #1
    Registered User
    Join Date
    Feb 2013
    Posts
    2

    c in real world

    hello every one,
    i want to ask a question from all of you, i am learning c language, solving different kind of problems like find the prime numbers bla bla bla, but i dont understand in reall world application which made up of c how this concept of calculating prime number will goings to help me, mean in complex applications how this concepts goings to help, please give me the answer i am searching for that

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    I have a quick "google was lucky for me" answer.
    https://en.wikipedia.org/wiki/C_%28p...nguage%29#Uses
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,694
    Well, you need to study some mathematics if you doubt which the value of the prime numbers are........ Cryptography for example uses them, but of course not as simple as most people are taught them.

    It's not nice to say bla bla bla, when you have no idea of what is all this about.
    Code - functions and small libraries I use


    It’s 2014 and I still use printf() for debugging.


    "Programs must be written for people to read, and only incidentally for machines to execute. " —Harold Abelson

  4. #4
    Registered User
    Join Date
    May 2010
    Posts
    4,632
    You learn to program by programming. So being given a simple task to write a program helps you learn. Also using a task that is easy to verify the answers allows you to verify your program works properly.

    Jim

  5. #5
    Registered User
    Join Date
    Sep 2008
    Location
    Toronto, Canada
    Posts
    1,834
    Unfortunately while you're learning C, you are going to get a lot of little unreal-world examples to work with. You are right they don't represent much usefulness in the real world but the point is that you are gradually learning how to put a problem into an algorithm, and then to code it in C.

    If someone came to you right now and asked you to code an Xs-and-Os program, or a precursor to chess such as a move validation check program... you may not yet have the skills to even know how to start. But if you persist in doing the little problems you will eventually train your brain to be able to attack such things - even work them out on a napkin during donut break, before touching programming.

    It took me months, maybe even a year in computer-science class to realize that all those calculating PI to umpteen places or working out the most efficient cylinder dimensions were indirectly disciplining my thought processes so that one day I would be equipped to tackle real problems.

    You will soon discover that any "real world" problems a much more difficult than the exercises given in class. If you can increase your skill level so that the class things are routine and simple, then you will have a fighting chance with real problems.

    What you’re given as exercises are meant to illustrate some new concept, such as perhaps arrays and other data structures. Or nested loops, recursion. Real-world problems require the use many or all of these tools in one program – and you will be able to pick from a storehouse of knowledge and know which is appropriate to use.

  6. #6
    Registered User
    Join Date
    Feb 2013
    Posts
    2
    thanks for your replying you give me the exact answer about what i am asking for..... one more question from you , how to be a good programmer in c or any other language according to you...? tell me paracticle things which i should do in order to become a good programmer in c..? thanks

  7. #7
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    one more question from you , how to be a good programmer in c or any other language according to you...? tell me paracticle things which i should do in order to become a good programmer in c..? thanks
    Like everything else in this life ... practice.

  8. #8
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    You start with simple things for the same reason that you first learned addition before learning differential and integral calculus, or why you probably read Dr. Seuss as a child rather than James Joyce. You do the simple things to build up the skill and experience to tackle bigger problems.

    As to how to get good:
    1. Program. Program a lot. The rule of 10,000 is that you can master almost any discipline if you spend 10,000 hours doing it. The biggest thing you can do is practice a lot. Realize you will never be "done" with learning. Knowing the programming language is to being a good programmer what knowing a natural language is to being a good author - you need to know the language before you can use it, but learning the language itself is only the first small step on the road. You need to practice using it well.

    2. In addition to practice, be critical of what you've done. There are many ways you can do this. Some of what I've done:
    - Read books about new ideas, design patterns, etc., and re-read old code to see how I could have done better by applying those ideas.
    - Ask others to review my work. Seek critical feedback on whether the approach I took was the right one.
    - Write freeware programs, get some users, and solicit bug reports, feature requests, and maintain the software.
    - Contribute to open-source libraries, etc. where my work will be peer reviewed. Solve bugs that the authors missed.

    Obviously some of those are more relevant than others at different levels of experience.
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

  9. #9
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,907
    I believe that following this forum is the best way to get good at C.

    Try and solve other peoples problems
    Try explaining things about the language to other people

    Watch how problems are solved by the more experienced people on here - See if your solution was close to theirs.

    What you will find is that the same problems keep re-occurring (why can't I write to an array that's declared as char * -> Because that is a pointer, not an array... Why is my float variable not getting accurate results -> floats are approximations of a number... ) After a little while, you'll realise that you've learned a lot from watching this forum.
    Fact - Beethoven wrote his first symphony in C

  10. #10
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Quote Originally Posted by geek0071 View Post
    thanks for your replying you give me the exact answer about what i am asking for..... one more question from you , how to be a good programmer in c or any other language according to you...? tell me paracticle things which i should do in order to become a good programmer in c..? thanks
    Sure, you begin by reading this -> Teach Yourself Programming in Ten Years
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  11. #11
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    You wont get anywhere with such a poor imagination or motivation.
    Most programmers, when shown a new tool quickly think of ways in which it can be useful. It's just like giving a man a hammer plus an infinite amount of wood and nails. Really, how can you not see how learning such things gives you the skill and the tools to make so much more!?!

    Frankly I don't think you can become a good programmer in C or any other language with the stance you have of what you have done so far.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to be a prgrammer in real world?
    By taigaicon in forum C Programming
    Replies: 3
    Last Post: 06-27-2011, 08:59 AM
  2. What do I need to improve on for the real world?
    By vhunterd in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 04-08-2007, 07:49 PM
  3. Design documents in the real world?
    By scoobasean in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 02-07-2006, 08:20 AM
  4. So what's the real world like when......
    By student in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 02-15-2002, 03:44 AM
  5. Real World
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 01-25-2002, 08:46 AM