for(;;){} what does it do? [duplicate] - c++

This question already has answers here:
What does "for(;;)" mean?
(5 answers)
Closed 7 years ago.
Simple question: I've been looking over boost's asio library, and keep coming across code like this.
for(;;){
//something
}
There's an example of this here.
Can anyone elaborate as to what using ";;" within a for loop does? I can't seem to understand it.

Its a simple infinite loop syntax, a complete code looks like this
for(<initialize>; <condition>; <increment/decrement>) {
<body>
}
Those I labelled with '< .. >' are optional.

Related

what does this line of syntax mean in c++? [duplicate]

This question already has answers here:
'colon' and 'auto' in for loop c++? need some help understanding the syntax
(3 answers)
Closed 7 months ago.
this is a quick question, Im translating a program that's in C++ to C, and I saw this line of code,
for (int v : adj[u]) {
referenced in this article: link
and I am not really sure what it does. I tried googling it and got results for range based for loops in C++, but cannot find anything that has this exact syntax and what it means. Help would be much appreciated.
It's a very simple for loop that iterates over the elements of adj[u], going 1 by 1.

How to use while loop to get answer (either yes or no) from users in Kotlin [duplicate]

This question already has answers here:
Kotlin: Why can't I do an assignment in a loop guard?
(4 answers)
Closed 4 years ago.
Greeting, You! I am learning Kotlin and I am struggling to use while loop to get answer from user. Not just that, if you could help explain how to use while loop to me, I would be really appreciate and thanks in advance.
You should use while(ans == 'Y').
In condition checking you should make use of == to check equality
And also in order to get repeated input put the readLine statement inside while loop.

How can an empty for(;;) work? [duplicate]

This question already has answers here:
No loop condition in for and while loop
(5 answers)
Closed 7 years ago.
How does an empty for works?
I have seen this code (and works perfectly)
for(;;) {
And I can't comprehend how is this working or why
It is exactly like while(true).
It skips all the conditions so it just empty-executes since in for the expressions are all optional (i.e. you don't have to provide them if you choose not to).

C++ Suggesting wrong spelled words [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
What algorithm gives suggestions in a spell checker?
What algorithm should be used in a C++ program whose aim is to read from a text file and give suggestions for the wrong spelled words ?
Use the Levenshtein distance:
http://thetechnofreak.com/technofreak/levenshtein-distance-implementation-c/
http://murilo.wordpress.com/2011/02/01/fast-and-easy-levenshtein-distance-using-a-trie-in-c/

Grab data inside code [duplicate]

This question already has answers here:
parse a xml in c++
(3 answers)
Closed 8 years ago.
So I have gotten the website source, and now im trying to grab the data inside the tags. How would I go about doing that. Thanks
For example,
<start>value</start>
Set a string to value
http://expat.sourceforge.net/ and http://msdn.microsoft.com/en-us/magazine/cc163436.aspx two more alternatives apart from http://xerces.apache.org/xerces-c/ as mentioned by mtahmed. There are plenty more. Please compare them based on your requirement.
You can use an XML parser library. Here is a link to one such library: http://xerces.apache.org/xerces-c/