Q/Confused
From: Joe Cipale (joec_at_aracnet.com)
Date: 04/30/04
- Next message: Hendrik Schober: "Re: Problem with overloading function templates"
- Previous message: Buster: "Re: ostream implementations (str, f, cout ) work slightly differently"
- Next in thread: Mike Wahler: "Re: Q/Confused"
- Reply: Mike Wahler: "Re: Q/Confused"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Apr 2004 10:14:56 -0700
I am trying to parse a data entry in a procedure. The procedure will
parse a data string on either a '/' or a ':'. My proceudre is delcared
as follows:
void chr_pad(char dte_str[16], char chr_tok)
The usage is:
chr_pad(dte_str, '/');
Within the code, I take advantage of the var 'chr_tok' in this manner:
strcpy(f1, strtok(dte_str, chr_tok));
strcpy(f2, strtok(NULL, chr_tok));
strcpy(f3, strtok(NULL, chr_tok));
When I attempt to compile the code, I get the following errors:
misc.cpp: In function `void chr_pad(char *, char)':
misc.cpp:360: passing `char' to argument 2 of `strtok(char *, const char
*)' lacks a cast
misc.cpp:361: passing `char' to argument 2 of `strtok(char *, const char
*)' lacks a cast
misc.cpp:362: passing `char' to argument 2 of `strtok(char *, const char
*)' lacks a cast
I am not seeing (blatantly) where the problem lies. Can one of you offer
a tip here?
TIA,
Joe Cipale
-- #----------------------------------------------------------# # "Don't fear the penguin!" # #----------------------------------------------------------# # Registered Linux user: #309247 http://counter.li.org # #----------------------------------------------------------#
- Next message: Hendrik Schober: "Re: Problem with overloading function templates"
- Previous message: Buster: "Re: ostream implementations (str, f, cout ) work slightly differently"
- Next in thread: Mike Wahler: "Re: Q/Confused"
- Reply: Mike Wahler: "Re: Q/Confused"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|