Strings কে সঠিক ভাবে ফরম্যাট করা ও ব্যবহার করা

Submitted by administrator on Mon, 01/02/2012 - 15:55

CLASS 13 - Manipulating Strings

 

In the last hour's lesson you learned how to use arrays to collect variables of the same type. You also learned that a character string is actually a character array ended with a null character \0. In this lesson you'll learn more about strings and C functions that can be used to manipulate strings. The following topics are covered:

    Declaring a string
    The length of a string
    Copying strings
    Reading strings with scanf(
    The gets() and puts() functions




Summary

  •     A string is a character array with a null character as the terminator at the last element.
  •     A string constant is a series of characters enclosed by double quotes.
  •     The C compiler automatically appends a null character to the array that has been initialized by a string constant.
  •     You cannot assign a string constant to a dereferenced char pointer.
  •     The strlen() function can be used to measure the length of a string. This function does not count the null character in the last element.
  •     You can copy a string from one array to another by calling the C function strcpy().
  •     The gets() function can be used to read a series of characters. This function stops reading when the newline character or end-of-file (EOF) is encountered. A null character is attached to the array that stores the characters automatically after the reading.
  •     The puts() function sends all characters, except the null character, in a string to the stdout, and appends a newline character to the output.
  •     You can read different data items with the scanf() function by using various format specifiers.


 

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 প্রোগ্রামিং ল্যাঙ্গুয়েজ দিয়ে অপারেটিং সিস্টেম, ডাটাবেস, ..