how can i use a string? what should i include to run string like "technogeek"
is it #include <string.h> or what and what is the syntax for string

Recommended Answers

All 11 Replies

string.h is for C programs, not C++. The std::string class is declared in <string> header file

#include <string>

using namespace std;

>>what is the syntax for string
Here is a complete list of string functions

We use:

#include <string>

Just remember that the term "string" generally means an ordered sequence of characters.
In an assignment, you could use something like:

sting actor = "Dani";
cout<<actor<<endl;

The above would print out Dani, when executed. Hope this helps.

can i ask what if, d user will type that string and that string is for shut down? what is the complete code of that.>>>>/>?

ExitWindowsEx() win32 api function. The second parameter shown below can be any one of several reason codes -- see the link for other reason codes.

string str = "Quit";
...
if( str == "Quit")
   ExitWindowsEx(EWX_SHUTDOWN, SHTDN_REASON_MAJOR_APPLICATION);

i know that is for c++ but can i ask what is the code of this in vb6?

i know that is for c++ but can i ask what is the code of this in vb6?

Good GOD man! THIS IS A C++ board!
When in Rome...

i know that but don't use captial letter bcoz it like a shouting one...

i know that is for c++ but can i ask what is the code of this in vb6?

You can ask but you won't get an answer. Ask the question in the VB6 board. Besides, I don't know the answer either because I don't write VB6 code.

posting your question to vb 6 forum, you will get many helps in there...

string wat is string? what is the code i can understand that ancient dragon can i give me a sample that will sort the 5 names to a-z
using array and looping in that string??

>>string wat is string?
Tutorial here

>>sample that will sort the 5 names to a-z
You have to understand character arrays before you will understand how to sort them. google for "sort algorithms", but from what you have already told us I doube you will understand what you read.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.