Thread: Array problem. Can you find the problem with this?

  1. #16
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,694
    Happy that made u smile

    Well I don't really know, but I can suppose...

    // end of spam c-board users :P
    // crossfire, have a happy && healthy new year
    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

  2. #17
    Registered User
    Join Date
    Dec 2012
    Posts
    307
    Program Ended with a return of 0
    press anykey to reply Thank you and you too!

  3. #18
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Crossfire
    If you write programs that will run in a tough environment, you don't want to rely on the initialized values at all, but rather set them in runtime before the variable is used. That is in a for-loop, which is the slowest but safest way to do it.
    What is a "tough environment"? I mean, if it is "tough" enough, then setting them with a for loop wouldn't work either
    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

  4. #19
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Quote Originally Posted by std10093 View Post
    Nobody knows about the empty initialiser ?? :/
    Sure. It is not valid C.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  5. #20
    Registered User
    Join Date
    Oct 2012
    Posts
    25
    Thank you Samaras and all!!

    what are you discussing about man xDDD

    however, I got it finnally using this code btw.

    Code:
    else{
    
    a=numberl[i];
    
    				for(i=i-1;i>=0;i--){
    printf("%d\n",number[i]);
    a is int variable and the else belongs to some "if" loop that's responsible for a<0.


    Thank you guys

  6. #21
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,694
    Thanks grumpy.

    Aitra, sorry for the manz posts .

    I am little worried about your for loop. The fact that i starts from i-1 worries me a little. If you are taking correct results, then ok, if not, it would be could to post all of zour code

    //I am from an italian keyboard, that=s why characters
    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

  7. #22
    Registered User
    Join Date
    Oct 2012
    Posts
    25
    It works so far Grazie tantissimo!!

    //I understand. having a German keyboard, there's always a y,z issue

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can't seem to find the problem, help.
    By JoeyJoe in forum C Programming
    Replies: 8
    Last Post: 03-04-2011, 02:03 PM
  2. help me to find the problem
    By behzad_shabani in forum C Programming
    Replies: 3
    Last Post: 06-12-2008, 01:17 AM
  3. pls help i cant find the problem :(((
    By condorx in forum C Programming
    Replies: 3
    Last Post: 11-07-2002, 09:05 AM
  4. Can't find problem
    By b-ref in forum C Programming
    Replies: 2
    Last Post: 12-06-2001, 05:39 AM
  5. can anyone find the problem in my code
    By ArseMan in forum C++ Programming
    Replies: 2
    Last Post: 09-20-2001, 09:02 PM