At the moment of showing the final data in C

1

Since I have a variable with stored data and I try to show it in a printf I do not get the data but a number that has nothing to do with it.

totalcasados is variable integer (int).

printf("Total de Casados: %d",&totalcasados);

should show a number under 15 and show "733245"

    
asked by Fernando28R 18.09.2017 в 20:42
source

1 answer

1

You are showing the memory address (pointer) instead of the value of your variable. Remove the ampersand:

printf("Total de Casados: %d", totalcasados);
    
answered by 18.09.2017 / 20:55
source