C
C
captcha13372020-04-21 20:19:05
C++ / C#
captcha1337, 2020-04-21 20:19:05

Error: format specifies type 'int' but the argument has type 'int (*)(int)?

I started learning C by watching the CS50 course.
There is a task to write a program that will count the number of 0.5l bottles of water spent in the shower for the number of minutes entered by the user.
It seems that everything was written correctly, but an error appears in the divis function (printf line)

#include <stdio.h>
#include <stdlib.h>
#include <cs50.h>

int main(void)
{
    int min = get_int("How much minutes do you spend in a shower?\n");
}

int lit (int min)
{
    return min * 6;
}

int divis (int lit)
{
    return lit / 0.5;
    printf("You have spent %i \n", divis);
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question