I came across this question in C++ Primer by Stanley Lippman.

const char ca[] = {'h', 'e', 'l', 'l', 'o'};
const char cp = ca;
cp )
cout << *cp << endl;

According to me, this code should produce indefinite result because of no specified null character at the end of the string, as the loop would continue until it finds a null character in any memory location.
But when I compiled the code, it runs for EXACLTY 13 times each times. WHy does the loop terminate after 13 iterations? OR Why is the null character present in the 13th memory location EACH TIME?
OR Im just wrong with my concepts, which I think I am.
Do help me.

me ->> really?



Homer --> Epiphany


Sure he was

No it wasn't.

Bump my sweet 18

Bored To Death

nerds, who don't get laid...(JK)

jingda commented: 1 word only +0

D'OH !

^ Is Indian...(me too...YAY)
< Is Schizophrenic
V Is a Time Killer..

im schizophrenic......

can i lick my ass?

pallazo --> D'OH ! (what the hell does pallazo mean?)

(sir) drink a lot



@kraai....t houught u were done with this

[QUOTE=Adak;1450601]What have you tried?

With linked lists, it's best to study it, and have a good sample program that you know works, to refer to while you are troubleshooting your own program.

I would either refer to your class/book notes on it for this, or grab a none good program from the net, and have it close at hand. Study it, to confirm that your idea of how it should work, corresponds correctly with the known good program.

Linked lists are a bit of a pain to just create out of thin air, if you're new to them, and have nothing to study in the way of good working code, first.[/QUOTE]

i think he heard the first time

oh come on, it cant get any simpler than [URL="http://www.cplusplus.com/reference/std/new/operator%20delete%5B%5D/"]this[/URL].
Just refer to the code snippet given, you should do fine

Oh come on guys



8 4 2 zzzzzz


nothing weird in my compiler; just got a simple textbox saying hello world. used visual c++ 2010.


venom of cobra

2726 lines just for tic tac toe ?! man you gotta be kidding me. i have one in c++, less than 150. get real dude.

the file here would be .txt, but the content would be binary. you can for sure open the file, but you cannot read it, unless you can understand binary.
if you want the contents in simple english, you cannot use read() and write() functions as these work only with binary file.
lookup file handling [URL="http://www.codersource.net/c/c-tutorial-on-file-operations/c-file-i-o.aspx"]here[/URL], or just google it for other results.