Click here to Skip to main content
15,924,196 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Array Size Pin
TeVc++28-Sep-08 22:14
TeVc++28-Sep-08 22:14 
GeneralRe: Array Size Pin
CPallini28-Sep-08 22:24
mveCPallini28-Sep-08 22:24 
GeneralRe: Array Size Pin
TeVc++28-Sep-08 23:25
TeVc++28-Sep-08 23:25 
QuestionRe: Array Size Pin
CPallini28-Sep-08 23:35
mveCPallini28-Sep-08 23:35 
AnswerRe: Array Size Pin
TeVc++28-Sep-08 23:49
TeVc++28-Sep-08 23:49 
GeneralRe: Array Size Pin
CPallini29-Sep-08 0:15
mveCPallini29-Sep-08 0:15 
GeneralRe: Array Size Pin
TeVc++29-Sep-08 0:32
TeVc++29-Sep-08 0:32 
GeneralRe: Array Size Pin
CPallini29-Sep-08 0:47
mveCPallini29-Sep-08 0:47 
If you need an array that grows dynamically then have a look at std::vector.
MFC has the CArray container but it's a crap (please don't tell this to Rajesh Roll eyes | :rolleyes: ).

very basic (and naive) vector usage sample follows:
#include <iostream>
#include <string>
#include <vector>

using namespace std;
void main()
{

  vector < string > v;

  v.push_back(string("hi,"));
  v.push_back(string("how"));
  v.push_back(string("do you do?"));
  cout << "vector size = " <<  v.size() << endl;
  for (int i=0; i<v.size(); i++)
  {
    cout << v[i] << " ";
  }
  cout << endl;
}


Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

GeneralRe: Array Size Pin
TeVc++29-Sep-08 19:45
TeVc++29-Sep-08 19:45 
GeneralYou are welcome. Pin
CPallini29-Sep-08 21:49
mveCPallini29-Sep-08 21:49 
Questiondynamic allocation of arrays [modified] Pin
Sauce!28-Sep-08 19:14
Sauce!28-Sep-08 19:14 
AnswerRe: dynamic allocation of arrays Pin
Saurabh.Garg28-Sep-08 19:23
Saurabh.Garg28-Sep-08 19:23 
GeneralRe: dynamic allocation of arrays Pin
Sauce!28-Sep-08 19:28
Sauce!28-Sep-08 19:28 
GeneralRe: dynamic allocation of arrays [modified] Pin
Sauce!29-Sep-08 21:01
Sauce!29-Sep-08 21:01 
GeneralRe: dynamic allocation of arrays Pin
Iain Clarke, Warrior Programmer30-Sep-08 0:20
Iain Clarke, Warrior Programmer30-Sep-08 0:20 
GeneralRe: dynamic allocation of arrays Pin
Sauce!30-Sep-08 0:55
Sauce!30-Sep-08 0:55 
GeneralRe: dynamic allocation of arrays Pin
Iain Clarke, Warrior Programmer30-Sep-08 1:25
Iain Clarke, Warrior Programmer30-Sep-08 1:25 
GeneralRe: dynamic allocation of arrays Pin
Sauce!30-Sep-08 1:34
Sauce!30-Sep-08 1:34 
GeneralRe: dynamic allocation of arrays Pin
Iain Clarke, Warrior Programmer30-Sep-08 1:48
Iain Clarke, Warrior Programmer30-Sep-08 1:48 
GeneralRe: dynamic allocation of arrays Pin
Sauce!30-Sep-08 2:16
Sauce!30-Sep-08 2:16 
GeneralRe: dynamic allocation of arrays Pin
Iain Clarke, Warrior Programmer30-Sep-08 3:21
Iain Clarke, Warrior Programmer30-Sep-08 3:21 
GeneralRe: dynamic allocation of arrays [modified] Pin
Sauce!30-Sep-08 5:01
Sauce!30-Sep-08 5:01 
GeneralRe: dynamic allocation of arrays Pin
Iain Clarke, Warrior Programmer30-Sep-08 5:31
Iain Clarke, Warrior Programmer30-Sep-08 5:31 
GeneralRe: dynamic allocation of arrays Pin
Sauce!30-Sep-08 5:43
Sauce!30-Sep-08 5:43 
GeneralRe: dynamic allocation of arrays Pin
Iain Clarke, Warrior Programmer30-Sep-08 6:02
Iain Clarke, Warrior Programmer30-Sep-08 6:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.