Thread overview | |||||
---|---|---|---|---|---|
|
September 12, 2008 Getting the string type to work | ||||
---|---|---|---|---|
| ||||
I have just downloaded DM C++, while testing out the features I seem to be stuck getting the string type to work. I have #include <string.h> and string str; in the main function. the compiler feeds back that string is an unidentified identifier. I have even tried to use std::string str; and still get an error. I want to make sure these basic fucntions work properly before purchasing the whole kit. |
September 21, 2008 Re: Getting the string type to work | ||||
---|---|---|---|---|
| ||||
Posted in reply to %u Craig Nelson | %u Craig Nelson wrote: > I have just downloaded DM C++, while testing out the features I > seem to be stuck getting the string type to work. I have > #include <string.h> > and > string str; > in the main function. the compiler feeds back that string is an > unidentified identifier. I have even tried to use std::string str; > and still get an error. I want to make sure these basic fucntions > work properly before purchasing the whole kit. Hi Craig, Both test cases: ------------------------------ #include <string> std::string globalS; int main() { std::string localS; return 0; } ------------------------------ and: ------------------------------ #include <string> using namespace std; string globalS; int main() { string localS; return 0; } ------------------------------ Compile without error for me. Are you sure you have stlport installed? Your sc.ini INCLUDE variable should look something like: INCLUDE="%@P%\..\stlport\stlport";"%@P%\..\include";"%@P%\..\mfc\include";%INCLUDE% |
November 17, 2008 Re: Getting the string type to work | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bryan Power | Good Morning Sir, My name is Gutta. I'm from India. coming to the issue, The header files are i.e stdio.h, conio.h, string.h...... If we want to use those files, Just we have to mention at starting of the program. i.e #include<string.h>. need not to call them into programming. i.e std::string local(); But if you creat a header file. i.e for user defined header files, we need to call them at the execution. For example, if you create a header file i.e gutta. #include<gutta.h> if you want to use the functions of the gutta header file. then you need to call like obj::gutta function(); Where obj is the current object name.with the object name "obj", we called the function() of gutta header file. "gutta" is a user defiened header file. I thought you got my point. still you have doubts on it. send me a message to my msn id. "gutta999@msn.com". Thank you Sir. |
Copyright © 1999-2021 by the D Language Foundation