Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to fix "assignment makes integer without a cast" **Update**
    primarykey
    data
    text
    <p>Okay here's the program I have typed up(stdio.h is included also):</p> <pre><code>/* function main begins program execution */ int main (int argc, char *argv[]) { int x; /*first number input*/ int y; /*second number input*/ int sum; /* variable in which sum will be stored */ int product; /* variable in which product will be stored */ int quotient; /* variable in which x divided by y will be stored */ int md; /* variable in which the modulo division of x divided by y */ x = argv[2]; /*assign total to x*/ y = argv[3]; /*assign total to y*/ if (argc ==3) { sum = x + y; /* assign total to sum */ printf("%d\n",sum); /*print sum*/ product = x * y; /*assign total to product*/ printf("%d\n", product); /*print product*/ quotient = x / y; /*assign total to quotient*/ printf("%d\n", quotient); /*print quotient*/ md = x % y; /*assign total to md*/ printf("%d\n", md); /*print md*/ } /*end if*/ if (argc !=3) { printf("need two integers\n"); /*need two integers*/ } return 0; /*indicate program ran successfully*/ } /*end of main*/ </code></pre> <p>When I run it through the compiler it says that in lines 15 and 16 (x= and y= lines) "assignment makes integer from pointer without a cast." How do I fix this?</p> <p>**I changed it to x=atoi(argv[2]) and y=atoi(argv[3]) and it fixed that problem. But as always something else has now screwed up. Now when I run the program I get:</p> <p>163 [main] a_4312 _cygtls::handle_exceptions: Error while dumping state </p> <p>Segmentation fault </p> <p>I read that this means I didn't allocate memory for the output or something like that...can anyone give me a hand here?**</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload