Chapter - 3: Graduating to C++

Can the following statements be written in any other way:


D
Sections
3
Exercises
employee *p;
p = (employee*)malloc(sizeof(e));
float q;
int a, b;
q = (float)a/b;

Answer:

employee *p;
p = new	employee*;
float q;
int a, b;
q = float(a)/b;

© 2021 Garbage Valuegarbage value logo