know yourselves. information, computer, 7 wonders, various.

Sunday, November 12, 2017

C++ programming language part: 42 String Array


String Array

Recall that two-dimensional array  is really a one-dimensional array whose component themselvs are one -dimensional array. When those component arrays are string, we have an array of string called String array. the usual way to declaration is char name[4][20]

Program 33_ext
                      {            char *name[]={ "Mousumi Akther",
                                 "Raj Ashraf",
                                 "Goerge Michel"
                                };
                        cout<<"The names are"<
                        for(int i=1;i<3 correct="" error="" i="" if="" misspelled="" nbsp="" o:p="" some="" the="">
                        cout<<"\t" <

Exercise: 1. Write and test the function that returns the plural from of the singular English word passed to it.

Hints: Make a function with  suppose {int len=strlen(s);  char* p=s+len-1; char* q=s+len-2 and if..else ladder    

            and make a Boolean function (isvowel) to check the letter is a vowel one. &  Try.  






জ্ঞানকোষ প্রকাশনী
৩৮/২-ক, বাংলাবাজার (২য় তলা), ঢাকা।
       ফোনঃ ৭১১৮৪৪৩, ৮১১২৪৪১, ৮৬২৩২৫১.         
                                                     
কলকাতায় পরিবেশক/প্রাপ্তিস্থান
রিতা ইন্টারন্যাশনাল
৩৬, পি.এন. ব্যানার্জি রোড, কলকাতা
ফোনঃ ২৫১৩৮৩৫৯, ৯৮৩০৪৩৯৬৭৯, +৯১৯৮৩০৪৩৯৬৭৯

C++ programming language part: 43 User defined data type


User defined data type

The fundamental data types are not only data types in C++. You can create your own data types. These data types are called the user define data type. There are two ways by which a user-defined data type is created. the first is by using the keyword called stuct and the second is by using the keyword called class. Furthermore, some element of a structure/class may be function, including operators.

Structure

Data types defined using the keyword struck are called as structures. A structure  is a collection of variables that are referanced by a single name. The variables can be os sifferent type. They provide a convinent means of keeping related information together.  Individuals structure elements can be referrened by conbining the .(dot) operater andthe -> operator is used when a structure element has to be accessed through a pointer.

Program 34
            //structure.demo
            #include
            #include

             struct student
             {
              int id;
              char name[10];
              char address[20];
             };                // either use terminator or would flag an error
        

             void main()
            {
             student st1,*st2,st3;
             cout<<" Type students id,name,address "<
             cin>>st1.id;
             cin>>st1.name;
             cin>>st1.address;
             cin>>st2->id;
             cin>>st2->name;
             cin>>st2->address;
             cin>>st3->id;
             cin>>st3->name;
             cin>>st3->address;

             cout<<" The datas are follows "<
             cout<
             cout<
             cout<
             cout<id<<" ";     //&st2->id
             cout<name<<" ";      //&st2->name
             cout<<&st2->address<<" ";    //&st2->address
             cout<
             cout<
             cout<


             }


Part- 86 assign the content of twostring



জ্ঞানকোষ প্রকাশনী
৩৮/২-ক, বাংলাবাজার (২য় তলা), ঢাকা।
       ফোনঃ ৭১১৮৪৪৩, ৮১১২৪৪১, ৮৬২৩২৫১.         
                                                     
কলকাতায় পরিবেশক/প্রাপ্তিস্থান
রিতা ইন্টারন্যাশনাল
৩৬, পি.এন. ব্যানার্জি রোড, কলকাতা
ফোনঃ ২৫১৩৮৩৫৯, ৯৮৩০৪৩৯৬৭৯, +৯১৯৮৩০৪৩৯৬৭৯