Like Tree1Likes
  • 1 Post By std10093

problem

This is a discussion on problem within the C++ Programming forums, part of the General Programming Boards category; Hey guys, I have a series problem really I understand the concept in c++ but I don't know how to ...

  1. #1
    Registered User
    Join Date
    Aug 2012
    Location
    Egypt
    Posts
    7

    problem

    Hey guys, I have a series problem really
    I understand the concept in c++ but I don't know how to solve PROBLEM the most of it.
    Give me advice how to think in the problem
    thnx

  2. #2
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,694
    Every problem has some difference.Some problems can be grouped.But the term problem is so general so no specific answer can be given.If what i said is false,then we would have one programming language that would solve all the problems ,but as you know there is no perfect language,only better language for some sections.

    You can start by actually understanding the problem.If you have a description of the problem be sure to read it as times as needed and understand every single line.If not ask the person that wrote the description for help.Then try to figure out how to solve the problem in paper maybe and then code

    For example:

    Problem:
    Code:
    Write a program that asks the user to input a name and then print to screen the name given.
    How would i approach it:
    [List][*]Read carefully the problem(trivial)[*]Solve the problem by the method divide and conquer.
    • The problem has two parts.
    • 1st - ask the user for the name
    • 2nd - use a function that will receive the input data
    • 3rd - write code to handle the input data.Store it somewhere(an array maybe)
    • 4rth - print the name in the screen
      [\List]
    • Now i would take every simple subproblem,solve it and then combine them all together so that the final problem is going to be solved.
    • 1st - i need a function to print in screen.printf sounds good.What i want to display in the screen?Hmm..Let's say "Please give your name"
    • 2nd - need to read the input.fgets or scanf may do the job
    • 3rd - i would use an array of chars pointers or of string to store the data
    • 4rth - use the same function as in sub-problem one<printf> and display the name that i have in the array and a message like this "Name given is : " (the msg should appear first)
    • Fun time-write code-listen to the compiler-solve the problem
    sarasaad likes this.

  3. #3
    Registered User
    Join Date
    Aug 2012
    Location
    Egypt
    Posts
    7
    Thank you very much
    I appreciate that

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sleep() function problem or logic problem?
    By FernandoBasso in forum C Programming
    Replies: 7
    Last Post: 11-16-2011, 05:50 PM
  2. strcmp problem, whats the problem, i cant figure it out!
    By AvaGodess in forum C Programming
    Replies: 14
    Last Post: 10-18-2008, 07:45 PM
  3. Replies: 4
    Last Post: 10-16-2008, 08:30 PM
  4. syntax linked list problem & struct problem
    By beely in forum C Programming
    Replies: 5
    Last Post: 11-11-2002, 09:14 AM
  5. Texture Problem(I got the NeHe tut working, but I have a problem)
    By SyntaxBubble in forum Game Programming
    Replies: 2
    Last Post: 12-02-2001, 10:40 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21