Posts by Oberdan Santos • 105 points
7 posts
-
4
votes1
answer86
viewsQ: Difficulty placing non-significant zeros in a converted binary number
I found a code on the web that converts decimals to binaries (32 bits), but I needed one (256 bits) so I changed the code in the way I thought was correct, but after the given size the…
casked Oberdan Santos 105 -
0
votes1
answer59
viewsQ: Counters are not being incremented in code
I am facing some difficulties with the code snippet below: The call of this function is: cache = OperaCache(true , endereco, op, cache, descricao, read_hits, read_misses, write_hits, write_misses);…
-
1
votes1
answer133
viewsQ: Convert assignments from C++ to C
I would like help to convert these made assignments into C++ to C: string binario = bitset<256>(address).to_string(); int InicioDado = 256-log2(cacheconfig.lineSize); string dado =…
-
0
votes1
answer91
viewsQ: Error in capturing information in files using the fseek() function... What’s the problem?
I’m having trouble with an Info capture function of a file with the fseek() function [I don’t know if there is a better alternative...]. Getting back to the problem, I want to read a file that has:…
-
0
votes0
answers40
viewsQ: The compilation is done without errors or warnings... But the program does not run!
I’m having some problems with the code below. The program compiles but an error occurs in the execution. From what I understand the problem is in printing... due to variable size size_t size of the…
-
2
votes1
answer110
viewsQ: Printing a vector... Differences between C++ and C... Where did I go wrong?
I’m having problems printing vector structs in C, in C++ it worked... First I will show the version in C with problems (in the execution because compiles without errors) CACHE cache =…
-
1
votes2
answers163
viewsQ: Converting a vector<struct> to C++ into C
I am trying to adapt a C++ function into pure C. I have changed the variable names and structs because it’s beside the point. typedef struct struct1 { int a; int b; int c; string d; } STRUCT1;…