Jump to content
everton

problema c++

Recommended Posts

Care e problema, ce prostii iti apar?

0xbf9543fe e ok, e in hexa. (32bit compilat cu bcc32)

0xfff4 e ok (16 bit, compilat cu bcc)

& nu se folosea din cauza printf ci se foloseste intotdeauna in C pentru adresa variabilelor.

Nu iti va afisa niciodata adresa reala, ci adresa in segmentul de memorie in care isi memoreaza datele.

Link to comment
Share on other sites

#include <iostream>
using namespace std;

int main()
{
unsigned long x, y[10];
x = 4;
y[0] = 0;
y[1] = 1;
cout << x << " " << &x << " " << int(&x);
cout << "\n";
cout << y << " " << &y; // cu sau fara & e tot aia ca y e pointer
cout << " " << &y[0];
system("pause >NUL");
return 0;
}

Foloseste int(&var) pentru a vedea valoarea respectiva in baza 10, prin prostie cum zicea si loki cred ca te referi ca ti-o arata in baza 16.

EDIT:

Inseamna ca iti face char() de ceva care este >127.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...