Click here to Skip to main content
15,920,053 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: VC.Net resource file always rebuilds Pin
Christian Graus19-Jan-02 13:59
protectorChristian Graus19-Jan-02 13:59 
GeneralRe: VC.Net resource file always rebuilds Pin
Tim Smith19-Jan-02 14:15
Tim Smith19-Jan-02 14:15 
GeneralArrays Pin
Alan Blakely19-Jan-02 11:32
Alan Blakely19-Jan-02 11:32 
GeneralRe: Arrays Pin
Christian Graus19-Jan-02 12:47
protectorChristian Graus19-Jan-02 12:47 
GeneralRe: Arrays Pin
Alan Blakely19-Jan-02 13:24
Alan Blakely19-Jan-02 13:24 
GeneralRe: Arrays Pin
Christian Graus19-Jan-02 22:56
protectorChristian Graus19-Jan-02 22:56 
GeneralRedimensioning Arrays Pin
DiegoValdevino19-Jan-02 11:16
DiegoValdevino19-Jan-02 11:16 
GeneralRe: Redimensioning Arrays Pin
Christian Graus19-Jan-02 11:25
protectorChristian Graus19-Jan-02 11:25 
You have two options.

1/ USe a pointer. Then you can do this:BYTE * pByte = new BYTE[256];

// use it

delete [] pByte;

pByte = new BYTE[300];

Of course every time you resize, you lose all the contents of the array.

2/ Use vector. Like this:

#include <vector>

vector<BYTE> vecBytes;

for (int i = 0; i < 256; ++i)
vecBytes.push_back(i);

now you have an array of 256 values that can be accessed using [n] notation if you like, or the .at function. But you can also delete from the ends and add new items dynamically at will.

If you want to delete from the middle you want list, but beware, list has the problem of slower access to individual fields ( as it's a linked list it must step through to the element you want )


Christian

I have come to clean zee pooollll. - Michael Martin Dec 30, 2001

<Center><A href = "http://www.sonork.com" target = "_Blank">Sonork</A> ID 100.10002:MeanManOz</Center><Center>I live in <U><B>Bob's HungOut</B></U> now</center>
GeneralRe: Redimensioning Arrays Pin
Prem Kumar19-Jan-02 11:30
Prem Kumar19-Jan-02 11:30 
GeneralRe: Redimensioning Arrays Pin
Christian Graus19-Jan-02 12:37
protectorChristian Graus19-Jan-02 12:37 
GeneralRe: Redimensioning Arrays Pin
l a u r e n19-Jan-02 23:05
l a u r e n19-Jan-02 23:05 
GeneralRe: Redimensioning Arrays Pin
Christian Graus19-Jan-02 23:31
protectorChristian Graus19-Jan-02 23:31 
GeneralToolbar graphic Pin
Jon Newman19-Jan-02 9:32
Jon Newman19-Jan-02 9:32 
GeneralMaintaining VC 5.0 and VC 6.0 Pin
Phil F19-Jan-02 9:14
Phil F19-Jan-02 9:14 
GeneralRe: Maintaining VC 5.0 and VC 6.0 Pin
Rick Crone24-Jan-02 10:21
Rick Crone24-Jan-02 10:21 
GeneralCD-RW questions...help needed Pin
Amit Dey19-Jan-02 8:17
Amit Dey19-Jan-02 8:17 
Questioncreating instance of class in other class? Pin
19-Jan-02 8:03
suss19-Jan-02 8:03 
AnswerRe: creating instance of class in other class? Pin
Christian Graus19-Jan-02 11:14
protectorChristian Graus19-Jan-02 11:14 
GeneralNeed help.. some MFC function Pin
19-Jan-02 7:12
suss19-Jan-02 7:12 
GeneralRe: Need help.. some MFC function Pin
User 665819-Jan-02 7:32
User 665819-Jan-02 7:32 
GeneralRe: Need help.. some MFC function Pin
20-Jan-02 17:21
suss20-Jan-02 17:21 
GeneralRe: Need help.. some MFC function Pin
Rick Crone24-Jan-02 10:25
Rick Crone24-Jan-02 10:25 
GeneralRe: Need help.. some MFC function Pin
Felix Cho20-Jan-02 4:24
Felix Cho20-Jan-02 4:24 
Generalparallel port with MFC Pin
19-Jan-02 4:27
suss19-Jan-02 4:27 
General[Message Deleted] Pin
19-Jan-02 5:13
suss19-Jan-02 5:13 

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.