Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

292
Views
¿Es correcto convertir a int después de desreferenciar un puntero vacío?
void* aPtr = NULL; // we don't yet know what it points to. ... aPtr = &height; // it has the address of height, but no type yet. ... int h = (int)*aPtr; // with casting, we can now go to that address // and fetch an integer value.

( Aprende Programación C; Jeff Szuhay )

'con el casting, ahora podemos ir [...]'

La pregunta es: ¿podemos realmente?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Eliminación de referencias y Casting Void Ptr (Aprender programación en C, Jeff Szuhay)

'con el casting, ahora podemos ir [...]'

La pregunta es: ¿podemos realmente?

Sí, pero el código que se muestra no elimina ninguna referencia. Bueno, intenta desreferenciar un void* y convertir el resultado en int . Así no es como se debe hacer. Primero debe convertir a int* y luego desreferenciar ese int* .

 int h = *(int*)aPtr; // now dereferenced ok (assuming `height` is an `int`) // ^ ^ // | | // | proper cast // | // dereferencing the right thing
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!