grazie, a questo punto mi conviene fare una cosa che può sembrare andare per le lunghe ma credo funzionerà:
obbero un hash che contiene in key il numero del "ciclo" ed in value il relativo "buffer len" da usare...modificando ad esempio il codice precedente così:codice:#include <stdlib.h> #include <map> #include <math.h> int main() { std::map<int, int> hashChunk; int dwBuffer = 100000; int dwChunk = 2304; int dwNumChunks = (int)ceil((double)dwBuffer/dwChunk); int dwLastChunk = dwChunk-((dwChunk*dwNumChunks)-dwBuffer); int k = 0; while (k < dwNumChunks - 1) { hashChunk.insert(std::make_pair(k, dwChunk)); ++k; } hashChunk.insert(std::make_pair(k, dwLastChunk)); int g = 0; while (g < dwNumChunks) { printf("%d -> %d\n", g, hashChunk[g]); ++g; } system("pause"); return 0; }
di più non so che fare...(se non dormire)codice:while(dwLoop < 4) { memcpy(sChunk, sBuffer+dwChunkSeek, hashChunk[dwLoop]); printf("%s\n", sChunk); ++dwLoop; dwChunkSeek += dwChunkLen; }



Rispondi quotando