Array of Objects in C++ | C ++ Tutorial | Mr. Kishore

preview_player
Показать описание
C ++ Tutorial Videos | Mr. Kishore

💡 Also Watch

Java Programming Tutorials by Mr.Hari krishna:
Advanced Java Programming Tutorials by Mr.Nataraj:

Subscribe to our channel and hit the bell 🔔🔔🔔 icon to get video updates.

💡 Visit Our Websites

#JavaCollectionsFramework #Tutorials #Videos #corejava #Quiz #Clanguage
--------------------------

💡 About NareshIT:

"Naresh IT is having 14+ years of experience in software training industry and the best Software Training Institute for online training, classroom training, weekend training, corporate training of Hadoop, Salesforce, AWS, DevOps, Spark, Data Science, Python, Tableau, RPA , Java, C#.NET, ASP.NET, Oracle, Testing Tools, Silver light, Linq, SQL Server, Selenium, Android, iPhone, C Language, C++, PHP and Digital Marketing in USA, Hyderabad, Chennai and Vijayawada, Bangalore India which provides online training across all the locations

--------------------------

💡 Our Online Training Features:
🎈 Training with Real-Time Experts
🎈 Industry Specific Scenario’s
🎈 Flexible Timings
🎈 Soft Copy of Material
🎈 Share Videos of each and every session.

--------------------------

💡 Please write back to us at

--------------------------

💡 Check The Below Links

Рекомендации по теме
Комментарии
Автор

Complete code:
Hope it will help :)

#include<iostream>
using namespace std;


class student{
int id;
char name[20];
public:
void getData(){
cout<<"Enter Student Details: "<<endl;
cin>>id>>name;
}

void putData();
};

void student::putData(){

}

int main(){

int n;
cin>>n;
student s[n];
if(n < 1 || n>60){
cout<<"enter number in range b/w [1-60]"<<endl;
}
else{
for(int i=0;i<n;i++){
s[i].getData();
}
}

cout<<"\tStudent id\t"<<"Student Name"<<endl;

for(int i=0;i<n;i++){
s[i].putData();
}

return 0;
}

raowl
Автор

i found it very useful for my lessons, thank you sir, keep publishing many videos related cpp,

techniphics
Автор

Best explanation! Even beginners can understand.

viththaldeshpande
Автор

after you show any example, you need to move from the blackboard because you block the view.

oceanview
Автор

don't need to put }; after declaration of funtion . it is rquire when you close the class.
and use int main() instead of using void main().

dholanaresh
Автор

What an explanation sir.Thank you so much.

_chandikagiri
Автор

Sir, can you make a video on how to sort these records in ascending order of the student id.

wel
Автор

Sir plzz arrange the videos in sequence

ShivaRaj-gvjj
Автор

Why do we have to use dynamic objects, instead we can get number of students form user and then define the object, like suppose n is number of students then "stu s[n]" initialization is made since in C++ we can declare variables at any place. Please some one answer me.

americacaptain
Автор

Really a useful and fabulous video sir. thank u so much sir

devas
Автор

sir, The program is not working. it gives the error of not declaring something. and sir i want to know that why we use }; after defining the function. and why also why we use clrscr().

mohneeshgarg
Автор

Sr plz updating an array in oop in c++ ka b aik program ki vedio upload kr dain plzzz its urgent sr

fatimarajpoot
Автор

Sir please full concept array chapter make a video please sir 🙏🙏

mdsazid
Автор

Hello sir, can we delete the particular Object from an Object array

pranjalbankar
Автор

if you want to initialize student dynamically using its constructor. Refer to this (very helpful).

rajanagarwal
Автор

//classes using array
#include <iostream>
#include <algorithm>
using namespace std;
class student
{
int id;
public:
void input_stu_data();
void display_stu_data();
};
void student::input_stu_data()
{
cin>>id;
}
void student::display_stu_data()
{
cout<<id<<endl;
}
int main()
{
student s[10];
int n, i;
cout<<"Enter number of student"<<endl;
cin>>n;
if(n<1 || n>10)
{
cout<<"Only 10 student data allowed";
}else
{
cout<<"Enter data"<<endl;
for(int i=0;i<n;i++)
s[i].input_stu_data();
sort(s, s+n);
cout<<"Student ID:"<<endl;
for(int i=0;i<n;i++)
s[i].display_stu_data();
}
}
here i am not able to sort the input data

saifhyder