P
Priya Mishra
Hi All
It was very nice to intract with this group, While in my previous post,
I was suggested to reffer the link, in order to learn C++,
Well I was going thoruigh the link in which i had some querry,
well below is the code.
#include <vector>
class Fred {
public:
Fred(int i, int j);
...
};
int main()
{
std::vector<Fred> a(10, Fred(5,7));
}
int main()
{
Fred a[10] = {
Fred(5,7), Fred(5,7), Fred(5,7), Fred(5,7), Fred(5,7),
Fred(5,7), Fred(5,7), Fred(5,7), Fred(5,7), Fred(5,7)
};
...
}
If we see both the above code, I come to conclusion is that,
Both are achiving the same fucntionalites, But the thing what
I want to know is what exactly std::vector do, ???
No doubt there must be some core diffrence between the above
implemented code.
Please I am try to learn C++ as all these days i have wroked with C
lang.
Thanks In Advance
Priya
It was very nice to intract with this group, While in my previous post,
I was suggested to reffer the link, in order to learn C++,
Well I was going thoruigh the link in which i had some querry,
well below is the code.
#include <vector>
class Fred {
public:
Fred(int i, int j);
...
};
int main()
{
std::vector<Fred> a(10, Fred(5,7));
}
int main()
{
Fred a[10] = {
Fred(5,7), Fred(5,7), Fred(5,7), Fred(5,7), Fred(5,7),
Fred(5,7), Fred(5,7), Fred(5,7), Fred(5,7), Fred(5,7)
};
...
}
If we see both the above code, I come to conclusion is that,
Both are achiving the same fucntionalites, But the thing what
I want to know is what exactly std::vector do, ???
No doubt there must be some core diffrence between the above
implemented code.
Please I am try to learn C++ as all these days i have wroked with C
lang.
Thanks In Advance
Priya