Like Tree3Likes
  • 1 Post By ledow
  • 1 Post By manasij7479
  • 1 Post By stahta01

errors in c

This is a discussion on errors in c within the C Programming forums, part of the General Programming Boards category; I just need some information about all kinds of usuall (syntax,logic,...)errors in c and how to correct them....

  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    2

    Lightbulb errors in c

    I just need some information about all kinds of usuall (syntax,logic,...)errors in c and how to correct them.

  2. #2
    Registered User ledow's Avatar
    Join Date
    Dec 2011
    Posts
    435
    No problem. I'll just tell you everything I know about things that took me years to learn, and which I still don't know 1% of everything about, because you asked so vaguely for everything and couldn't be bothered to Google, say, "common C errors" or similar?

    Just what kind of response were you expecting?
    rags_to_riches likes this.

    - Compiler warnings are like "Bridge Out Ahead" warnings. DON'T just ignore them.
    - A compiler error is something SO stupid that the compiler genuinely can't carry on with its job. A compiler warning is the compiler saying "Well, that's bloody stupid but if you WANT to ignore me..." and carrying on.
    - The best debugging tool in the world is a bunch of printf()'s for everything important around the bits you think might be wrong.

  3. #3
    Technical Lead QuantumPete's Avatar
    Join Date
    Aug 2007
    Location
    London, UK
    Posts
    894
    Quote Originally Posted by aliok View Post
    I just need some information about all kinds of usuall (syntax,logic,...)errors in c and how to correct them.
    Then you should spend a few years writing C programs.
    "No-one else has reported this problem, you're either crazy or a liar" - Dogbert Technical Support
    "Have you tried turning it off and on again?" - The IT Crowd

  4. #4
    Registered User
    Join Date
    Jan 2011
    Posts
    141
    Write programs. Your bound to make mistakes. When you do, copy/paste the errors into google. You should get alot of hits with users having gone through the same problem

  5. #5
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,498
    Quote Originally Posted by bos1234 View Post
    Write programs. Your bound to make mistakes. When you do, copy/paste the errors into google. You should get alot of hits with users having gone through the same problem
    Ah... now that is a real solution to cure segmentation faults. After all, all those getting it must be making the exact same mistake. :S
    bos1234 likes this.
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  6. #6
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    Heh, I need my car battery replaced.. wait why am I posting here?
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  7. #7
    Registered User
    Join Date
    Apr 2012
    Posts
    2
    Never mind I figured it out. Thanks anyways. I don't know how to delete posts so that is why I didn't.

  8. #8
    Registered User
    Join Date
    May 2009
    Posts
    2,664
    Salem likes this.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the Universe is winning." Rick Cook

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why am I getting these errors??
    By maxthecat in forum Windows Programming
    Replies: 3
    Last Post: 02-03-2006, 12:00 PM
  2. Errors!
    By maxorator in forum Windows Programming
    Replies: 3
    Last Post: 12-15-2005, 07:59 PM
  3. Help with errors
    By sublime in forum C Programming
    Replies: 11
    Last Post: 11-11-2005, 02:23 PM
  4. errors.. errrors.. more errors
    By Klinerr1 in forum C++ Programming
    Replies: 17
    Last Post: 07-23-2002, 08:43 PM
  5. Dev and errors
    By Moffesto in forum C++ Programming
    Replies: 0
    Last Post: 06-22-2002, 12:17 AM

Tags for this Thread


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