Dervish1 37 Newbie Poster

I've used it more recently than that, but primarily when I was working on code generators for compilers - so everything else could be written in higher-level languages. In other words, there are certain environments where it's useful, but they tend to be pretty specialized, as Rubberman said.

Dervish1 37 Newbie Poster

And if you wish to simply print text with a newline in it, it's \n, not /n.

Dervish1 37 Newbie Poster

This ends up being several different items, some of which I believe require javascript. HTML supports a text box, and you can put preloaded text into it. Using CSS you can make it a fixed height and scrolling. I don't know how, but I suspect CSS can let you auto highlight an entire line when you click.

But if you want to pop up a window, that will involve some (relatively simple) javascript. You would need to find out which line the user clicked on, and then select what image to load.

All of these you should be able to find online - try doing each one, one at a time.

If you don't have quite so much time, you might look at some of the various javascript toolkits out there. dojo (the one I'm most familiar with, not necessarily the best) supports several types of text box and might make the automation easier, if you can get past their sometimes-impenetrable documentation.

scarletfire commented: Thanks! +1
Dervish1 37 Newbie Poster

The short answer is that you are getting lucky. According to the standard, if the size of the data requested in malloc is 0, the result is implementation-defined. In your case, it appears to be allocating a small block of memory -- it's also legal for the compiler to return NULL, or to crash your computer (although that last is probably not very desirable!).

It's entirely possible, by the way, that you're writing over other memory that has been allocated to your program; this kind of error can be very hard to detect in more complex cases. At the very least, you should check the return value of malloc and do something different if it's NULL. I wouldn't expect this code to work in all environments.

Ancient Dragon commented: Good explaination :) +28
tux4life commented: Nice :) +8