cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Problem with class
Problem with class
Jun 28, 2011 at 5:50am UTC
shahin007
(8)
Hello ,
I can't understand "char
*str
"!!!
plz help me!
1
2
3
4
5
class
samp{
char
s[80];
public
:
void
set (
char
*str){strcpy(s,str)} };
Jun 28, 2011 at 7:00am UTC
hamsterman
(4538)
set is a method. It takes one argument of type
char
*
. That is a pointer to a
char
. It is meant to point to the first character of a string. This is the information a function needs to deal with a null terminated string. What else should I tell you?
See
http://www.cplusplus.com/doc/tutorial/ntcs/
and
http://www.cplusplus.com/doc/tutorial/pointers/
I guess.
Last edited on
Jun 28, 2011 at 7:01am UTC
Jun 28, 2011 at 12:17pm UTC
shahin007
(8)
tanx alot!!!
Topic archived. No new replies allowed.