struct c++
//Struct is a compound data type that contains different variables of different types.
struct Student
{
char stuName[30];
int stuRollNo;
int stuAge;
};
struct c++
//Struct is a compound data type that contains different variables of different types.
struct Student
{
char stuName[30];
int stuRollNo;
int stuAge;
};
structs in c++
#include <bits/stdc++.h>
#include <iostream>
#define ll long long
using namespace std;
struct student{
int roll;
string name;
int age;
void studentDetails(){
cout<<"Name is "<<name<<" Age is "<<age<<" roll no is "<<roll<<endl;
}
};
int main(){
student sumant;
sumant.roll = 30;
sumant.name = "Sumant Tirkey";
sumant.age = 18;
sumant.studentDetails();
cout<<endl;
return 0;
}
how to create a struct in c++
struct product {
int weight;
double price;
} ;
product apple;
product banana, melon;
what is a struct in c++
struct Person
{
char name[50];
int age;
float salary;
};
struct c++
struct Student
{
string Nom;
int Surn;
int Age;
};
struct c++
struct product {
int weight;
double price;
} apple, banana, melon;
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us