![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on std string help! within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; I want to use string in std but I get errors when I do: using namespace std; and when I ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() |
I want to use string in std but I get errors when I do:
using namespace std; and when I try this too: std::string blah; How do I use string? I think its because i am using C and not c++ but how would you do it in C? Last edited by pspballer07; 05-31-2007 at 03:35 PM.. |
|
|
|
|
|
#2 |
![]() No longer a community member.
|
if you are using namespace of std then why are you calling it as std::string ???
I take it you are wanting to use C++ standard strings. take a look at this resource C++ Strings |
|
|
|
|
|
#5 |
![]() |
Actually it was <iostream>
I decided to give up with strings because I got it to work but then I had all these undefined reference errors after it compiled. So my next question is this: Take a look at the code Code:
void Reader(char str[][])
{
//do stuff with str
}
int main()
{
//do stuff
char data[1][20];
strcpy(data[0],"Hello");
Reader(data);
return 0;
}
array has incomplete element type and for the call to Reader() I get the errors: incompatible types in assignment type of formal parameter 1 is incomplete I tried using char** instead but that doesn't work either help! |
|
|
|
|
|
#8 | |
![]() |
Quote:
-= Double Post =- OK, after a ton of trial and error, I solved my problem I ended up using char *data[] instead of char data[][] Last edited by pspballer07; 05-31-2007 at 05:03 PM.. Reason: Automerged Doublepost |
|
|
|
|
|
|
#10 |
![]() ![]() Developer
|
The undefined errors are from NOT linking the C++ STL library. Look in the C/C++ help thread to see how.
__________________
[Blog] [Portfolio] [Homebrew Illuminati - Serious Homebrew Development Forums] [I want to make Homebrew FAQ] [How I broke into the Games Industry] [Programming Book List] [Programming Article List] |
|
|
|
![]() |
| Tags |
| std , string |
| Thread Tools | |
|
|