Submitted by tushar pramanick on Fri, 03/08/2013 - 00:21

The goto Statement

I feel that this book would not be not complete without mentioning the goto statement, although I do not recommend that you use the goto statement unless it's absolutely necessary. The main reason that the goto statement is discouraged is because its usage may make the C program unreliable and hard to debug.

The following is the general form of the goto statement:

labelname:
   statement1;
   statement2;
   .
   .
   .
   goto  labelname;


Here labelname is a label name that tells the goto statement where to jump. You have to place labelname in two places: One is at the place where the goto statement is going to jump (note that a colon must follow the label name), and the other is the place following the goto keyword. You have to follow the same rules to make a label name as you name a variable or function.

Also, the place for the goto statement to jump to can appear either before or after the statement.

Related Items

C প্রোগ্রাম এর ডেটা টাইপ এবং নামকরণ করার পদ্ধতি

ক্লাস 4: C ল্যাঙ্গুয়েজ এর ডেটা টাইপ এবং নেম

CLASS 4: Data Types and Names in C

C প্রোগ্রাম এর প্রয়োজনীয় উপকরন

C Programs এর প্রয়োজনীয় উপকরন

এই অধ্যায়ে আমরা শিখবো সি প্রোগ্রামিং এর জন্য কিছু প্রয়োজনীয় জিনিস । যেমন

সহজ সরল প্রথম C প্রোগ্রাম টি লিখতে শিখুন

আমরা জানি C একটি উচ্চ-স্তরের প্রোগ্রামিং ভাষা এবং C প্রোগ্রামগুলি বাইনারি কোডে অনুবাদ করতে C কম্পাইলার (Compiler) দরকার হয় । বাইনারি কোড কম্পিউটার বুঝতে পারে এবং এক্সিকিউট করতে পারে। C প্রোগ্রাম লিখতে যে বেসিক জিনিসগুলি জানতে হবে

C প্রোগ্রামিং কিভাবে শুরু করবে ?

C একটি প্রোগ্রামিং ল্যাঙ্গুয়েজ । C ল্যাঙ্গুয়েজ প্রথম তৈরি করেন ডেনিস রিচি (Dennis Ritchie) 1972 সালে AT&T Bell ল্যাবে । ডেনিস রিচি এর নাম দেন ল্যাঙ্গুয়েজ C । কারন এর আগে B বলে আগে থেকেই আর একটি প্ররগ্রামিং ল্যাঙ্গুয়েজ ছিল।

C programming in Bengali

C প্রোগ্রামিং ল্যাঙ্গুয়েজ শেখার জন্য আগে থেকে কোনও প্রোগ্রামিং ল্যাঙ্গুয়েজ জানার প্রয়োজন নেই, যদিও কম্পিউটারের সম্পর্কে কিছু জ্ঞান থাকার দরকার । C একটি শক্তিশালী সাধারণ উদ্দেশ্যে ব্যাবহৃত প্রোগ্রামিং ল্যাঙ্গুয়েজ। C প্রোগ্রামিং ল্যাঙ্গুয়েজ দিয়ে অপারেটিং সিস্টেম, ডাটাবেস, ..