invalid conversion from *void to *int [-fpermissive] using malloc(sizeof())
问题 I'm writing a program that calculates the greatest common denominator of two numbers, but i'm getting problem with malloc function and pointers. Actually it's clear how the stack and the heap segments work in the memory and why. But yet i'm not yet able to understand when declaring a pointer and using malloc is functional or not, is necessary or not, in a program. here is the code : #include <iostream> #include <stdlib.h> #include <stdio.h> int *calcolaDivisori(int); int main(int argc, char**