0

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

5
Contributors
11
Replies
12
Views
9 Years
Discussion Span
Last Post by Ancient Dragon
0

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

0

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.

0

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.>>>>/>?

0

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);
0

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

Edited by happygeek: fixed formatting

0

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...

0

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.

0

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??

0

>>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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.