Questions tagged [casting]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
108 views

PSET 4 - Filter Grayscale

I've managed to make Filter Grayscale work. It wasn't too complicated, I was just missing to cast each color to float as such; void grayscale(int height, int width, RGBTRIPLE image[height][width]) { ...
0
votes
2answers
164 views

pset 2 segmentation fault?

I have segmentation fault somewhere, with gdb i found that it gives the fault at return a inside cypher() function, can i fix it?: /* caesar.c Carlos Lopez J. luchillo17@gmail.com ...
2
votes
1answer
2k views

Can't cast a float to an int?

For the life of me I cannot get this float to cast to an int, and I don't know why – I've tried a number of different things, including printing it as an int, which seems to have worked (printf("%d" , ...
0
votes
1answer
600 views

Pset4 error: invalid operands to binary expression ('double' and 'double (*)(void)')

The following error occurs in the lines where the velocity of the ball is initialized/changed using the drand48 function: When velocity is initialized : if(getEventType(event) == MOUSE_CLICKED) { ...
9
votes
2answers
304 views

What happens under the hood when performing a cast?

In the walkthrough example, ASCII-0.c, a cast has been performed to convert a number (integer in specific) to a character. I would like to know what exactly happens at the lower level when we cast an ...