Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Pomoc oko 2 zadatka

[es] :: C/C++ programiranje :: Pomoc oko 2 zadatka

[ Pregleda: 2210 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

Nibble

Član broj: 63173
Poruke: 302
*.dlp146.bih.net.ba.



+1 Profil

icon Pomoc oko 2 zadatka10.01.2006. u 17:20 - pre 221 meseci
Moze li mi ko uraditi bilo koja od ova 2 zadatka.Uradio bi ove zadatke ali nekontam kada trebam prebaciti npr double u unsigned char* i td.

Evo Zadatka 1

Code:
Create a function that takes a pointer to an array of
double and a value indicating the size of that array. The
function should print each element in the array. Now
create an array of double and initialize each element to
zero, then use your function to print the array. Next use
reinterpret_cast to cast the starting address of your array
to an unsigned char*, and set each byte of the array to 1
(hint: you’ll need to use sizeof to calculate the number of
bytes in a double). Now use your array-printing function
to print the results.




Evo 2

Code:

Define an array of int. Take the starting address of that
array and use static_cast to convert it into an void*.
Write a function that takes a void*, a number (indicating
a number of bytes), and a value (indicating the value to
which each byte should be set) as arguments. The
function should set each byte in the specified range to the
specified value. Try out the function on your array of int.


[Ovu poruku je menjao Nibble dana 10.01.2006. u 18:20 GMT+1]
 
Odgovor na temu

osmica
Beograd

Član broj: 38009
Poruke: 74
*.ppp-bg.sezampro.yu.

Sajt: www.imagenedthe.com


Profil

icon Re: Pomoc oko 2 zadatka11.01.2006. u 23:13 - pre 221 meseci
Imas tu malo vise od 2 zadatka,...Ti pocni pa kad naidjes na problem,vici!!!!
Ja ne znam sta ti nekontas kada treba?Procitaj pazljivo zadatke.
Pozzzzz!
Ivan :)
 
Odgovor na temu

[es] :: C/C++ programiranje :: Pomoc oko 2 zadatka

[ Pregleda: 2210 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.