Thread: Coding trouble

  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    16

    Coding trouble

    Fixed!
    Last edited by Guru_; 08-29-2009 at 01:10 PM.

  2. #2
    Not stupid, just stupider yaya's Avatar
    Join Date
    May 2007
    Location
    Earthland
    Posts
    204
    You should indent your code, as it makes it hard for everyone to read.

    And is this all your code? I suspect there would be an #include<iostream> and more. And there is more open curly brackets then there are closed. Without getting your functions correct, it's hard to say what's wrong with your if else statement.

  3. #3
    Registered User
    Join Date
    Apr 2009
    Posts
    16
    Parts of the code I didn't post. The main trouble I have is on the if else then part

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Post, in [code][/code] tags, the smallest and simplest program that demonstrates the problem.
    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

  5. #5
    Ugly C Lover audinue's Avatar
    Join Date
    Jun 2008
    Location
    Indonesia
    Posts
    489
    What is that "Void result" and "void procces"?

    A variable?
    Just GET it OFF out my mind!!

  6. #6
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Variables can't be void anyway, so this code is just totally bogus.
    You cannot tell me that this code is compiling.
    Post the real code, or if it doesn't compile, indent and post the compile errors. Or just fix them.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #7
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    You cannot tell me that this code is compiling.
    Agreed. I cannot see how it would compile as is. Perhaps when you pasted the code there were typos or perhaps the paste did not work correctly.

  8. #8
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    Quote Originally Posted by Guru_ View Post
    Fixed!
    You'll get "Fixed" if you remove the contents of your original post one more time...
    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"

  9. #9
    Registered User
    Join Date
    Apr 2009
    Posts
    16
    Quote Originally Posted by iMalc View Post
    You'll get "Fixed" if you remove the contents of your original post one more time...

    what?

  10. #10
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Guru_
    what?
    Do not edit out your original post to remove your question. It makes the replies meaningless unless they have quoted enough of your question.
    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

  11. #11
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    I think the solution for this person is to just immediately reply with the entire contents of their posted code, so it's saved for posterity. Hopefully they will do this on all the other forums he's spamming as well.

  12. #12
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    Quote Originally Posted by Guru_ View Post
    what?
    I only spoke up because I noticed that it was at least the second time you had done it...

    What you post here is not just for your benefit. You may not be clever enough to always Google around for answers to your problem before posting, but others are and quite often they have the same problem as someone else had. Even if it was a stupid mistake, if it is posted here then someone somewhere else is almost guaranteed to learn something from it sooner or later.

    Being a beginner needn't mean you have any less (or more) to contribute than those who have a lot more knowledge. Someone has to ask the questions or the knowledge sharing just wont happen.
    Knowing that now, whether it's questions or answers you have to contribute, don't be selfish removing them afterwards ok?

    Thanks, and see you around.
    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. Replies: 9
    Last Post: 03-20-2009, 05:22 PM
  2. Coding Guideline ....!!
    By imfeelingfortun in forum Tech Board
    Replies: 8
    Last Post: 10-08-2006, 07:09 AM
  3. Palindrome Coding trouble
    By TheLoneWolf32 in forum C++ Programming
    Replies: 3
    Last Post: 02-22-2003, 07:05 PM
  4. Coding Contest....
    By Koshare in forum A Brief History of Cprogramming.com
    Replies: 46
    Last Post: 10-14-2001, 04:32 PM