Debug quick c++
₹600-1500 INR
Paid on delivery
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];
}
}
Project ID: #13810075
About the project
8 freelancers are bidding on average ₹1306 for this job
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 More
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 More
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 More
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.
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