![]() |
|
#1
|
|||
|
|||
LoopsHi im having a problem creating some loops in my program.
Basically i was trying to impliment a loop that runs until 16384 bytes have been captured. I then want to run a loop inside this one that cuts the 16384 bytes into 32 byte chunks starting at the first byte and cutting it into chunks from there. I have had a go at this but i cnt seem to get anything to work, can anyone help me to correctly impliment this? thanks Code:
|
|
#2
|
|||
|
|||
Re: LoopsIt sounds to me like you want to store your bytes into an array like:
CPP / C++ / C Code:
CPP / C++ / C Code:
|
|
#3
|
|||
|
|||
Re: LoopsYer overal i have for example 512 bytes. I need to loop through the 512 bytes starting at byte 1. I need to capture a block of 32 bytes. With that 32 bytes i need to look at the structure and do some calculations. Once im done with that 32 bytes i would then need to move to the next 32 which will be bytes 33-64 and produce the same calculations. This would have to be done until i finally example all chunks in the 512 bytes
|
|
#4
|
|||
|
|||
Re: LoopsOK. How about this:
CPP / C++ / C Code:
|
|
#5
|
|||
|
|||
Re: LoopsQuote:
Doesn't your code attempt to read 16384 bytes? (512*32 = 16384) Shouldn't the outer loop limit be 16? (16*32 = 512) Regards, Dave |
|
#6
|
|||
|
|||
Re: LoopsQuote:
|
|
#7
|
|||
|
|||
Re: LoopsQuote:
Upon reflection, I am thinking your code is in keeping with the assignment. Sorry to muddy the waters. Regards, Dave |
Recent GIDBlog
Prepping for deployment by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What exactly are real world examples that utilize structured loops? | lynlawdac | CPP / C++ Forum | 2 | 13-Nov-2007 09:06 |
| Having Problems with Loops | cristale10 | CPP / C++ Forum | 2 | 02-Oct-2006 14:58 |
| nested for loops | sandeepeecs | C Programming Language | 3 | 20-Aug-2006 08:49 |
| Help with nested for loops...please. sorry newbie | keperry | CPP / C++ Forum | 14 | 16-Oct-2004 11:25 |
| Help using nested for loops | dontcare | CPP / C++ Forum | 1 | 03-Oct-2004 12:33 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The