?
=?ISO-8859-1?Q?Dennis_Pl=F6ger?=
Hi all!
I'm currently having some problems parsing a char array in c++. (And
yes, I'm a half-newbie ;-)) Perhaps you can help me with this:
#include <iostream>
using std::cout;
void outchar(char *outcharstring)
{
cout << outcharstring;
}
void ftest(char *teststring)
{
int i=0;
while (teststring != '\0')
{
outchar(&teststring);
i++;
}
}
int main()
{
char test[]="Hello.";
ftest(test);
}
Of course, this is just a sample program. But basically I would like
to give a function, that needs the adress of a string, a char, that is
one item of another string.
The output of the code above is:
Hello.ello.llo.lo.o..
What I would like is just "Hello.". How can I accomplish this?
Thanks everybody.
Dennis
I'm currently having some problems parsing a char array in c++. (And
yes, I'm a half-newbie ;-)) Perhaps you can help me with this:
#include <iostream>
using std::cout;
void outchar(char *outcharstring)
{
cout << outcharstring;
}
void ftest(char *teststring)
{
int i=0;
while (teststring != '\0')
{
outchar(&teststring);
i++;
}
}
int main()
{
char test[]="Hello.";
ftest(test);
}
Of course, this is just a sample program. But basically I would like
to give a function, that needs the adress of a string, a char, that is
one item of another string.
The output of the code above is:
Hello.ello.llo.lo.o..
What I would like is just "Hello.". How can I accomplish this?
Thanks everybody.
Dennis