Click here to Skip to main content
15,887,331 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionOwner draw ListCtrl Pin
Patrick Markl30-Jan-06 1:04
Patrick Markl30-Jan-06 1:04 
QuestionDocument Conversion Pin
itbuff30-Jan-06 0:30
itbuff30-Jan-06 0:30 
AnswerRe: Document Conversion Pin
Sebastian Schneider30-Jan-06 1:17
Sebastian Schneider30-Jan-06 1:17 
QuestionOnNcCalcSize in CListBox Pin
Nishad S30-Jan-06 0:05
Nishad S30-Jan-06 0:05 
QuestionLoading an array inside a class.. Pin
Eytukan29-Jan-06 23:37
Eytukan29-Jan-06 23:37 
AnswerRe: Loading an array inside a class.. Pin
baldha rakesh29-Jan-06 23:58
baldha rakesh29-Jan-06 23:58 
GeneralRe: Loading an array inside a class.. Pin
Eytukan30-Jan-06 0:24
Eytukan30-Jan-06 0:24 
AnswerRe: Loading an array inside a class.. Pin
toxcct30-Jan-06 0:34
toxcct30-Jan-06 0:34 
because the initialisation is not made as the same time as the declaration (in a class), you cannot use such a thing.

i advise you to do it like this :
<font color=blue>class</font> test {
    <font color=blue>int</font> a[10];
 
  <font color=blue>public</font>:
    test();
};
 
<code>--------------------</code>
 
test::test() {
    a[0] = 1;
    a[1] = 2;
    <font color=green>//...</font>
    a[9] = 10;
}

now, if you have a very long list of values, then you can do the following as better practice :
<font color=blue>class</font> test {
    <font color=blue>int</font> a[100];
 
  <font color=blue>public</font>:
    test();
};
 
<code>--------------------</code>
 
test::test() {
    <font color=blue>int</font> tab[100] = {<font color=gray>...val array...</font>};
    <font color=blue>for</font> (<font color=blue>int</font> i = 0; i < 100; i++) {
        <font color=blue>this</font>->a[i] = tab[i];
    }
}




TOXCCT >>> GEII power
[toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
GeneralRe: Loading an array inside a class.. Pin
Prakash Nadar30-Jan-06 0:38
Prakash Nadar30-Jan-06 0:38 
GeneralRe: Loading an array inside a class.. Pin
toxcct30-Jan-06 0:39
toxcct30-Jan-06 0:39 
GeneralRe: Loading an array inside a class.. Pin
Prakash Nadar30-Jan-06 0:41
Prakash Nadar30-Jan-06 0:41 
GeneralRe: Loading an array inside a class.. Pin
Eytukan30-Jan-06 0:45
Eytukan30-Jan-06 0:45 
GeneralRe: Loading an array inside a class.. Pin
Prakash Nadar30-Jan-06 0:52
Prakash Nadar30-Jan-06 0:52 
GeneralRe: Loading an array inside a class.. Pin
toxcct30-Jan-06 2:01
toxcct30-Jan-06 2:01 
GeneralRe: Loading an array inside a class.. Pin
BadKarma30-Jan-06 2:26
BadKarma30-Jan-06 2:26 
GeneralRe: Loading an array inside a class.. Pin
Eytukan30-Jan-06 3:02
Eytukan30-Jan-06 3:02 
GeneralRe: Loading an array inside a class.. Pin
Eytukan30-Jan-06 0:40
Eytukan30-Jan-06 0:40 
GeneralRe: Loading an array inside a class.. Pin
toxcct30-Jan-06 0:44
toxcct30-Jan-06 0:44 
GeneralRe: Loading an array inside a class.. Pin
Eytukan30-Jan-06 0:45
Eytukan30-Jan-06 0:45 
AnswerRe: Loading an array inside a class.. Pin
David Crow30-Jan-06 3:08
David Crow30-Jan-06 3:08 
GeneralRe: Loading an array inside a class.. Pin
toxcct30-Jan-06 3:14
toxcct30-Jan-06 3:14 
GeneralRe: Loading an array inside a class.. Pin
David Crow30-Jan-06 3:20
David Crow30-Jan-06 3:20 
GeneralRe: Loading an array inside a class.. Pin
Eytukan30-Jan-06 3:22
Eytukan30-Jan-06 3:22 
GeneralRe: Loading an array inside a class.. Pin
Eytukan30-Jan-06 3:25
Eytukan30-Jan-06 3:25 
GeneralRe: Loading an array inside a class.. Pin
David Crow30-Jan-06 3:32
David Crow30-Jan-06 3:32 

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.