Skip to main content

Questions tagged [casting]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
741 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]) { ...
highpointer's user avatar
0 votes
2 answers
173 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. [email protected] ...
Carlos Esteban Lopez Jaramillo's user avatar
2 votes
1 answer
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" , ...
Andrew Venezia's user avatar
0 votes
1 answer
713 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) { ...
user1580's user avatar
9 votes
2 answers
782 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 ...
Pooja's user avatar
  • 139