Subject: C++ problem
From: [email-masked] ("Horia F. Pop")

8 Dec 1996 01:36:19 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.01 (Win95; I)
Original-To: [email-masked]
Original-Sender: [email-masked]

Dear sirs,

I just installed B17. I have a problem with one of the string handling
functions. Please see the source:

-------------------
#include <string.h>
#include <stdio.h>

main()
{
  char *x, *y;
  x = strtok("123 456 789 abc", " ");
  y = strtok(x, " ");

  printf("%s %s\n", x, y);
}
-------------------

and the compilation output:

-------------------
t.cc: In function `int main()':
t.cc:7: warning: implicit declaration of function `int strtok(...)'
t.cc:7: warning: assignment to `char *' from `int' lacks a cast
t.cc:8: warning: assignment to `char *' from `int' lacks a cast
-------------------

Even if the function strtok is in the file string.h, the conditionals
inside the header seem to comment the declaration of the function. What
do I have to do? The executable produces a runtime error.

Thank you for your help.

Yours, Horia Pop
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".