public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jane Liang <JLiang@lgc.com>
To: "'GCC-help'" <gcc-help@gcc.gnu.org>
Subject: Help wanted
Date: Mon, 17 Mar 2003 16:44:00 -0000	[thread overview]
Message-ID: <57A168CAC1B2A6409978DF309F6FDB39C4EB12@lgchexch008.ad.lgc.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 677 bytes --]

Hi, all:

I have a simple program(see below), it ran without any problem in sun (with
sun's compiler). However, when I compiled it in gcc on PC, it crashed at
line 13.  I tried to use strtok and some other string functions but none of
them seems works fine.  Does anyone know why?

Thanks!

Jane


Line 1    #include <stdlib.h>
Line 2    #include <stdio.h>
Line 3    #include <string.h>
Line 4
Line 5    int main()
Line 6    {
Line 7
Line 8      char *str = "0.12000, 0.0, 0.0";
Line 9      char *ptr;
Line 10     float  num;
Line 11
Line 12     ptr = strchr(str, ',');
Line 13     *ptr = '\0';
Line 14 
Line 15     num = atof(str);
Line 16
Line 17     return 0;
Line 18   }



[-- Attachment #1.2: Type: text/html, Size: 2213 bytes --]

             reply	other threads:[~2003-03-17 16:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-17 16:44 Jane Liang [this message]
2003-03-17 16:53 ` Ben Davis
  -- strict thread matches above, loose matches on Subject: below --
2003-03-17 19:16 Jane Liang
2002-08-12  8:22 help wanted rojesh  p
2001-10-10 22:06 Danish Samad
2001-10-10 23:44 ` Rupert Wood

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=57A168CAC1B2A6409978DF309F6FDB39C4EB12@lgchexch008.ad.lgc.com \
    --to=jliang@lgc.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).