public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: "eric lin" <ericlin@fsshl.zzn.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: simple binary search program and gdb, plz help
Date: Tue, 31 May 2011 12:20:00 -0000	[thread overview]
Message-ID: <mcrtycbs9ef.fsf@coign.corp.google.com> (raw)
In-Reply-To: <DE2AA575A912CDF46912FF5F751C5E13@ericlin.fsshl.zzn.com> (eric	lin's message of "Mon, 30 May 2011 11:47:02 -0700")

"eric lin" <ericlin@fsshl.zzn.com> writes:

>   I copy a piece of simple code from c++ book (practical c++ programing) , page 296, chapter Debugging and optimation
> with input also according its indicated , increasing in order in numbers.dat (page 289)  file

This mailing list does not exist to help you learn how to program.
Sorry.

>     std::sscanf(line, "0", &data[max_count]);

This line looks wrong to me.

I recommend that you take basic debugging steps like adding some print
statements to verify that the array is what you expect, or run the
program under a debugger.

Ian

      reply	other threads:[~2011-05-31  5:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-30 22:00 eric lin
2011-05-31 12:20 ` Ian Lance Taylor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mcrtycbs9ef.fsf@coign.corp.google.com \
    --to=iant@google.com \
    --cc=ericlin@fsshl.zzn.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).