Initialization of a variable in for loop in c language

why the piece of code like

for(int i=0;i<19;i++)
{
printf("hello");
}

is an error,that is why in C,the variable can't be initialized within the for loop,while in other programming languages it is possible,so basically whats the reason behind it.

Replies

You are reading an archived discussion.

Related Posts

Hi Folks, Can you please let me know, which are the best data visualization languages (Java Scripting, JSON, css or any other) which is the best and simple to embed...
We've been comparing various 110cc scooters available in India for about Rs. 50,000 and have narrowed down on Honda Activa i and TVS Zest. Both the scooters are lightweight, offer...
Quote: It will be the biggest wheel in the world - 135m high, weighing more than 1,500 tonnes and rotating at two revolutions an hour - if everything goes to...
This festive season, a breeze of fresh air enters India's 100 cc bike segment as Hero MotoCorp launches two new motorcycles named Hero Splendor Pro Classic, India's first café racer...