SlideShare a Scribd company logo
1 of 2
class Array
{
    private:
        int size;
        int *pointer;

     public:
        Array()
        {
             size=0;
                           pointer=NULL;
       }

     void load()
     {
         cout <<"Enter the number of integers in the array.nn";
         cin >>size;
         pointer = new int[size];
         int i;
         for (i=0; i< size; i++)
         {
             cout <<"Enter interger # " << i+1 <<"n";
             cin >>*(pointer+i);


           }
                     }//end of load

     void print()
     {
        int i =0;
        cout <<"The array contains " <<size << "integers.nn";
        cout <<"They are:n";
         while (i < size)
            {
                cout <<i+1<<")t"<<*(pointer+i)<<endl;
                  i++;

               }//end of loop

       }

     ~Array()        //destructor to delete the array
     {
         delete []pointer;
     }

};

void main (void)
{
    Array array1;
    array1.load();
    array1.print();
    array1.~Array();
}

____________________________________________

More Related Content

What's hot

basic programs in C++
basic programs in C++ basic programs in C++
basic programs in C++ Arun Nair
 
C- Programs - Harsh
C- Programs - HarshC- Programs - Harsh
C- Programs - HarshHarsh Sharma
 
Array using recursion
Array using recursionArray using recursion
Array using recursionSwarup Boro
 
CODE Data Structures
CODE Data StructuresCODE Data Structures
CODE Data StructuresSonia Pahuja
 
Program membalik kata
Program membalik kataProgram membalik kata
Program membalik katahaqiemisme
 
Static Variable in C++
Static Variable in C++Static Variable in C++
Static Variable in C++Nasir Hamidon
 
C++ question 6 || solution of Programming Problem
C++ question 6 || solution of Programming Problem C++ question 6 || solution of Programming Problem
C++ question 6 || solution of Programming Problem Topics MixeR
 
Functors, applicatives, monads
Functors, applicatives, monadsFunctors, applicatives, monads
Functors, applicatives, monadsrkaippully
 
メディアアートにおけるプログラミング言語Rubyの役割
メディアアートにおけるプログラミング言語Rubyの役割メディアアートにおけるプログラミング言語Rubyの役割
メディアアートにおけるプログラミング言語Rubyの役割Koichiro Eto
 

What's hot (20)

Introduction to Go for Java Programmers
Introduction to Go for Java ProgrammersIntroduction to Go for Java Programmers
Introduction to Go for Java Programmers
 
basic programs in C++
basic programs in C++ basic programs in C++
basic programs in C++
 
C- Programs - Harsh
C- Programs - HarshC- Programs - Harsh
C- Programs - Harsh
 
ProgrammingwithGOLang
ProgrammingwithGOLangProgrammingwithGOLang
ProgrammingwithGOLang
 
week-5x
week-5xweek-5x
week-5x
 
Cpp c++ 2
Cpp c++ 2Cpp c++ 2
Cpp c++ 2
 
Array using recursion
Array using recursionArray using recursion
Array using recursion
 
Oopsprc1c
Oopsprc1cOopsprc1c
Oopsprc1c
 
CODE Data Structures
CODE Data StructuresCODE Data Structures
CODE Data Structures
 
Program membalik kata
Program membalik kataProgram membalik kata
Program membalik kata
 
Static Variable in C++
Static Variable in C++Static Variable in C++
Static Variable in C++
 
Include
IncludeInclude
Include
 
C++ question 6 || solution of Programming Problem
C++ question 6 || solution of Programming Problem C++ question 6 || solution of Programming Problem
C++ question 6 || solution of Programming Problem
 
Cpp
Cpp Cpp
Cpp
 
Ooprc4 b
Ooprc4 bOoprc4 b
Ooprc4 b
 
Cpp tutorial
Cpp tutorialCpp tutorial
Cpp tutorial
 
Functors, applicatives, monads
Functors, applicatives, monadsFunctors, applicatives, monads
Functors, applicatives, monads
 
Oop1
Oop1Oop1
Oop1
 
メディアアートにおけるプログラミング言語Rubyの役割
メディアアートにおけるプログラミング言語Rubyの役割メディアアートにおけるプログラミング言語Rubyの役割
メディアアートにおけるプログラミング言語Rubyの役割
 
cosc 281 hw2
cosc 281 hw2cosc 281 hw2
cosc 281 hw2
 

Viewers also liked

Group Risk Assessment Form
Group Risk Assessment FormGroup Risk Assessment Form
Group Risk Assessment Formt012588
 
Presentación3.ppt
Presentación3.pptPresentación3.ppt
Presentación3.pptdarymary
 
Boekenhouder evaluatie 1.2 b
Boekenhouder evaluatie 1.2 bBoekenhouder evaluatie 1.2 b
Boekenhouder evaluatie 1.2 bJasmienDecancq
 
Preguntas abuelo
Preguntas abueloPreguntas abuelo
Preguntas abueloinasadaba
 
Product Work Log
Product Work LogProduct Work Log
Product Work LogSpecter-kc
 
Document11
Document11Document11
Document11isteven
 
Lawspeed Awr Handout
Lawspeed Awr HandoutLawspeed Awr Handout
Lawspeed Awr HandoutRickycoleman
 
Workshop Enunciados Gerais e Enunciados Específicos
Workshop Enunciados Gerais e Enunciados EspecíficosWorkshop Enunciados Gerais e Enunciados Específicos
Workshop Enunciados Gerais e Enunciados EspecíficosSílvia Baltazar
 
Examiner new frontiers july 2011 page 1
Examiner   new frontiers july 2011 page 1Examiner   new frontiers july 2011 page 1
Examiner new frontiers july 2011 page 1retreathouse
 
30 new products for our 30 years
30 new products for our 30 years30 new products for our 30 years
30 new products for our 30 yearsLika Electronic
 
2ª Fase - Nível 2 - 2011
2ª Fase - Nível 2 - 20112ª Fase - Nível 2 - 2011
2ª Fase - Nível 2 - 2011oim_matematica
 

Viewers also liked (20)

Autor do mês
Autor do mêsAutor do mês
Autor do mês
 
Group Risk Assessment Form
Group Risk Assessment FormGroup Risk Assessment Form
Group Risk Assessment Form
 
Hibridacion
HibridacionHibridacion
Hibridacion
 
Yoli planta(1)
Yoli planta(1)Yoli planta(1)
Yoli planta(1)
 
A beleza dos números
A beleza dos númerosA beleza dos números
A beleza dos números
 
Presentación3.ppt
Presentación3.pptPresentación3.ppt
Presentación3.ppt
 
Boekenhouder evaluatie 1.2 b
Boekenhouder evaluatie 1.2 bBoekenhouder evaluatie 1.2 b
Boekenhouder evaluatie 1.2 b
 
Cabo Coaxial DLC 58 - RF
Cabo Coaxial DLC 58 - RFCabo Coaxial DLC 58 - RF
Cabo Coaxial DLC 58 - RF
 
Preguntas abuelo
Preguntas abueloPreguntas abuelo
Preguntas abuelo
 
Product Work Log
Product Work LogProduct Work Log
Product Work Log
 
FOTOyMÁS
FOTOyMÁSFOTOyMÁS
FOTOyMÁS
 
Document11
Document11Document11
Document11
 
Lawspeed Awr Handout
Lawspeed Awr HandoutLawspeed Awr Handout
Lawspeed Awr Handout
 
Workshop Enunciados Gerais e Enunciados Específicos
Workshop Enunciados Gerais e Enunciados EspecíficosWorkshop Enunciados Gerais e Enunciados Específicos
Workshop Enunciados Gerais e Enunciados Específicos
 
Hirlevel
HirlevelHirlevel
Hirlevel
 
Hibridacion angie
Hibridacion angieHibridacion angie
Hibridacion angie
 
Examiner new frontiers july 2011 page 1
Examiner   new frontiers july 2011 page 1Examiner   new frontiers july 2011 page 1
Examiner new frontiers july 2011 page 1
 
30 new products for our 30 years
30 new products for our 30 years30 new products for our 30 years
30 new products for our 30 years
 
2ª Fase - Nível 2 - 2011
2ª Fase - Nível 2 - 20112ª Fase - Nível 2 - 2011
2ª Fase - Nível 2 - 2011
 
Dicas
DicasDicas
Dicas
 

Similar to Class array

#include String.hpp#include ..Functionsfunctions.hpp.docx
#include String.hpp#include ..Functionsfunctions.hpp.docx#include String.hpp#include ..Functionsfunctions.hpp.docx
#include String.hpp#include ..Functionsfunctions.hpp.docxgertrudebellgrove
 
Oops lab manual2
Oops lab manual2Oops lab manual2
Oops lab manual2Mouna Guru
 
C++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfC++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfyamew16788
 
Array and string in C++_093547 analysis.pptx
Array and string in C++_093547 analysis.pptxArray and string in C++_093547 analysis.pptx
Array and string in C++_093547 analysis.pptxJumanneChiyanda
 
CBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical fileCBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical filePranav Ghildiyal
 
Queue Implementation Using Array & Linked List
Queue Implementation Using Array & Linked ListQueue Implementation Using Array & Linked List
Queue Implementation Using Array & Linked ListPTCL
 
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdfDoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdfaathiauto
 
Structured data type
Structured data typeStructured data type
Structured data typeOmkar Majukar
 
a) Write the recursive function in C++ to sort a set of data using M.pdf
a) Write the recursive function in C++ to sort a set of data using M.pdfa) Write the recursive function in C++ to sort a set of data using M.pdf
a) Write the recursive function in C++ to sort a set of data using M.pdfnageswara1958
 
(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf
(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf
(Parent reference for BST) Redefine TreeNode by adding a reference to.pdfarihantelehyb
 
Object oriented programming; operator overloading array
Object oriented programming; operator overloading arrayObject oriented programming; operator overloading array
Object oriented programming; operator overloading arraySyed Zaid Irshad
 
Computer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdfComputer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdfHIMANSUKUMAR12
 
I have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdfI have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdfshreeaadithyaacellso
 

Similar to Class array (20)

#include String.hpp#include ..Functionsfunctions.hpp.docx
#include String.hpp#include ..Functionsfunctions.hpp.docx#include String.hpp#include ..Functionsfunctions.hpp.docx
#include String.hpp#include ..Functionsfunctions.hpp.docx
 
Oops lab manual2
Oops lab manual2Oops lab manual2
Oops lab manual2
 
C++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfC++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdf
 
Ds 2 cycle
Ds 2 cycleDs 2 cycle
Ds 2 cycle
 
Array and string in C++_093547 analysis.pptx
Array and string in C++_093547 analysis.pptxArray and string in C++_093547 analysis.pptx
Array and string in C++_093547 analysis.pptx
 
CBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical fileCBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical file
 
Queue Implementation Using Array & Linked List
Queue Implementation Using Array & Linked ListQueue Implementation Using Array & Linked List
Queue Implementation Using Array & Linked List
 
Opp compile
Opp compileOpp compile
Opp compile
 
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdfDoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
 
Structured data type
Structured data typeStructured data type
Structured data type
 
a) Write the recursive function in C++ to sort a set of data using M.pdf
a) Write the recursive function in C++ to sort a set of data using M.pdfa) Write the recursive function in C++ to sort a set of data using M.pdf
a) Write the recursive function in C++ to sort a set of data using M.pdf
 
Fp201 unit4
Fp201 unit4Fp201 unit4
Fp201 unit4
 
(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf
(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf
(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf
 
Object oriented programming; operator overloading array
Object oriented programming; operator overloading arrayObject oriented programming; operator overloading array
Object oriented programming; operator overloading array
 
C++ practical
C++ practicalC++ practical
C++ practical
 
Cpp c++ 1
Cpp c++ 1Cpp c++ 1
Cpp c++ 1
 
Arrays in C++
Arrays in C++Arrays in C++
Arrays in C++
 
SlideSet_4_Arraysnew.pdf
SlideSet_4_Arraysnew.pdfSlideSet_4_Arraysnew.pdf
SlideSet_4_Arraysnew.pdf
 
Computer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdfComputer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdf
 
I have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdfI have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdf
 

Recently uploaded

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 

Recently uploaded (20)

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 

Class array

  • 1. class Array { private: int size; int *pointer; public: Array() { size=0; pointer=NULL; } void load() { cout <<"Enter the number of integers in the array.nn"; cin >>size; pointer = new int[size]; int i; for (i=0; i< size; i++) { cout <<"Enter interger # " << i+1 <<"n"; cin >>*(pointer+i); } }//end of load void print() { int i =0; cout <<"The array contains " <<size << "integers.nn"; cout <<"They are:n"; while (i < size) { cout <<i+1<<")t"<<*(pointer+i)<<endl; i++; }//end of loop } ~Array() //destructor to delete the array { delete []pointer; } }; void main (void) { Array array1; array1.load(); array1.print(); array1.~Array();