answersLogoWhite

0

Yes, you can create array that will store class properties. But all of them have to be of the same type.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

How can you store Class properties in Array in c sharp?

vcbvcbcvb


How can write a c program to store students record in a file?

Write a console based C++ program that reads student information from a text file, build an array of objects of type class StudentInfo,


What is an array of class objects.how the array of class of class objects is defined in c plus plus?

An array of class objects is just a set of class objects arranged linearly in memory. It is no different than an array of elementary objects. You define it the same way. class myClass { ... }; myClass arrayOfMyClass[100]; // creates 100 objects and fires the constructor 100 times


Write a program to show array within class in c?

class is defined in c++ my dear so in C there is no structure of class.for c++ class private { int x[10],y; cout


In C programming a character variable can at a time store how many characters?

You can store one, however if you make a char array: char[50]; You can make a string out of your array of characters.


What is the array of string in c?

A string in C is stored in a 1 dimension array so an array of strings is simply a two dimension array.


What is the definition of class and object in cpp?

CLASS-A group of objects that shares common properties and relationship.In C++, class is a new data type that contain member functions and member variable that operate on the variable. A class can be defined with keyword ClassOBJECT-An entity that store data send and receive messages. An instance of class.


What is the lowest subscript of an array in c plus plus?

The lowest subscript of an array in C, or C++ is 0.


Is it mandatory to use array in foreach loop C-sharp can foreach be used without array?

Foreach is for an IEnumerable, not just an array (unless you are using C# 1.1 or earlier). A collection (List, Dictionary, etc) can also generate a sequence from foreach-statement. In fact, if you have a class that is NOT an array, but it implements all the required methods of IEnumerable, it may be applied as:public class Storage: IEnumerable {...}Storage myStorage = new Storage();...Foreach (Thing stuff in myStorage){...}


Difference between array and pointers in c plus plus?

A pointer is simply a variable that can store a memory address and has the same purpose in both languages. The only real difference is that C++ pointers can point at objects (instances of a class) and indirectly invoke their methods, whereas pointers in C (which is not object oriented) cannot.


How do you make a C plus plus program that arrange the the numbers in ascending order?

Heres something i whipped up in a hurry... This uses the Bubble Sort method found (related links) #include <iostream> using namespace std; int main(int argc, const char* argv) { int arraysize = 5; //Unsorted array size int array [] = { 5, 3, 4, 2, 1 }; //The array of numbers itself //Display the unsorted array cout << "Before: {"; for (int c=0; c <= arraysize; c++) { cout << array[c]; if (c != arraysize) { cout << ","; } } cout << "}" << endl; //Acctually sort the array int tmp=0; //Used for swaping values for (int loop=0; loop <= (arraysize - 1); loop++) { for (int c=0; c <= (arraysize - 1); c++) //The sort loop { if (array[c] > array[c + 1]) { //Swaps the two values in the array tmp = array[c]; array[c] = array[c + 1]; array[c + 1] = tmp; //Cleanup tmp = 0; } } } //Display the sorted array cout << "After: {"; for (int c=0; c <= arraysize; c++) { cout << array[c]; if (c != arraysize) { cout << ","; } } cout << "}" << endl; return 0; }


How do you declare a string array and add elements to it in C plus plus?

You cannot add elements to a fixed array in C or C++. If, however, the array is declared as a pointer to an array, you can add elements by allocating a new array, copying/adding elements as needed, reassigning the new array to the pointer, and deallocating the original array.