Debug quick c++

Закрито Опубліковано %project.relative_time Оплачується при отриманні
Закрито Оплачується при отриманні

Please can you fix the bug where i'm getting for some values of orderReverse -1 original value from order ?

//main

int order[4] = { 0 };

while (nDataLen >= 2 * 4)

{

func3(order, readFile);

unsigned int previous = 0;

unsigned int w = 1;

for (int i = 0; i < 4; i++) {

previous += w * (order[i]);

w *= 256;

}

}

char bitStringr[33] = {'0'};

Get_string32_from_SIZE4_VALUE(bitStringr, previous);

int orderReverse[56];

orderReverse[0] = Get_CHAR_ARRAY_SIZE4_FROM_VALUE(bitStringr);

int ic = 0;

char bitStringr1[33] = {'0'};

for (int i = 8; i < 16; i++ ) {

bitStringr1[ic] = bitStringr[i]; ic++;

}

orderReverse[1] = Get_CHAR_ARRAY_SIZE4_FROM_VALUE(bitStringr1);

ic = 0;

for (int i = 16; i < 24; i++) {

bitStringr1[ic] = bitStringr[i]; ic++;

}

orderReverse[2] = Get_CHAR_ARRAY_SIZE4_FROM_VALUE(bitStringr1);

ic = 0;

for (int i = 24; i < 32; i++) {

bitStringr1[ic] = bitStringr[i]; ic++;

}

orderReverse[3] = Get_CHAR_ARRAY_SIZE4_FROM_VALUE(bitStringr1);

//Functions

void Get_string32_from_SIZE4_VALUE(char* sz_output, unsigned int val)

{

sz_output[0] = 0;

unsigned int v = 1;

unsigned int n = 0;

for (int i = 0; i < 32; i++)

{

sz_output[n++] = (val & v) ? '1' : '0';

v <<= 1;

}

sz_output[n] = 0;

}

char Get_CHAR_ARRAY_SIZE4_FROM_VALUE(char* sz_input)

{

unsigned short v = 1;

unsigned short n = 0;

for (int i = 0; i < 32; i++)

{

n += (sz_input[i] == '1') ? v : 0;

v <<= 1;

}

return n;

}

void func3(int* dst_Array, FILE* src_InputFile)

{

char buf[8];/////////////////////////////

fread(buf, 1, 8, src_InputFile);

for (int i = 0; i < 4; i++)

{

dst_Array[i] = buf[i];

}

}

Програмування на С Програмування на C++

ID Проекту: #13810075

Про проект

8 заявок(-ки) Дистанційний проект Остання активність 6 роки(ів) тому

8 фрілансерів(-и) готові виконати цю роботу у середньому за ₹1306

nitekum

12+ years in C++ Design and Development. Current role in SW architect in GE research . Having experience of IBM Research , Toshiba Research , TIVo inc . If you want to work with highly experienced and best in cla Більше

₹1750 INR за 1 день
(1 відгук)
3.4
duality1333

Good day, I'd be happy to assist you with this task. I have extensive experience in C++ as it was the primary language used for all projects while completing my degree (education) in Canada. Please PM me to discu Більше

₹1450 INR за 1 день
(1 відгук)
0.8
JeffersoonNG

Hi, I'm very interested in getting this job. I can give you the results you are expecting in 10 minutes. I only need information about some missing variables in your code (nDataLen, readFile and previous). Thank Більше

₹1250 INR за 0 дні(-в)
(0 відгуків(и))
0.0
techfinity3

DDear Prospect Hiring Manager. Thank you for giving me a chance to bid on your project. i am a serious bidder here and i have already worked on a similar project before and can deliver as u have mentioned I have Більше

₹1361 INR за 7 дні(-в)
(0 відгуків(и))
0.0
ramkishangurjar

i am good with c++, and have great knowledge and experience. i think i can debug your code on time. looking forward to work on this.

₹750 INR за 1 день
(0 відгуків(и))
0.0
skriyaz09

I have been working as a software developer for more than one and half year on C++ and having good knowledge of algorithms and data structures and good problem solving skills and debugging skills

₹1450 INR за 1 день
(0 відгуків(и))
0.0
dipta007

Hi, I am Dipta. I am a contest programmer and my fav language is c/c++.. I am an ex-software developer in a reputed company in Bangladesh and working in this field for 2 years. Through this, I have gathered a good kno Більше

₹850 INR за 1 день
(0 відгуків(и))
0.0