c++ - Error Message "invalid conversion from ‘void*’ to ‘unsigned int’" -



c++ - Error Message "invalid conversion from ‘void*’ to ‘unsigned int’" -

i have unsigned int function (it's given function task)

// read info virtual memory unsigned int read(const int index) { homecoming speicher[index]; }

in speicher[index] number, have decode in 4 components. first component value of speicher[index] mod 16, sec component value of (speicher[index])/(16*16)mod16 think , on.

other illustration error message. maybe can't understand function does:

for me function read(const int index) should homecoming unsigned int number, can utilize "normal" other unsigned int number in program.

unsigned int index = 0; unsigned int test = 1; { unsigned int hexzahl = read(index); test = read(index); index = index + 1; } while (index <= 255 && read(index) != 0); // 37 want, programme breaks if content of read(index) 0

i can't understand error message:

main.cpp: in function ‘int main()’:

main.cpp:37: error: iso c++ forbids comparing between pointer , integer

main.cpp:37: error: invalid conversion ‘char* ()(const char, int)’ ‘int’

main.cpp:37: error: initializing argument 1 of ‘unsigned int memory_read(int)’

what expect do?

unsigned int hexzahl = (cout << dec << read(index));

this prints value, tries assign status of cout stream integer. makes no sense, why won't compile.

if want set hexzahl result of read, that:

unsigned int hexzahl = read(index);

and if want print value separately:

cout << dec << hexzahl;

if want other result of read, please update question describe you're trying do.

c++

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -