When using memset it errors with ISO C++ forbids declatration of 'memset' with no type.
Type: Posts; User: spazx
When using memset it errors with ISO C++ forbids declatration of 'memset' with no type.
So how do I initialize the array as -1?
The line of code does not work. It produces the error message that there is an error making 'map' static.
int map[NROWS][NCOLS] = {[{-1}][{-1}]};
Thank you both for helping me, it is not having compiler errors for that.
if (dyofwk % 7 == 0) strcpy("Monday",week);
else if (dyofwk % 7 == 1) strcpy("Tuesday",week);
else if (dyofwk % 7 == 2) strcpy("Wednesday",week);
else if (dyofwk % 7 == 3) strcpy("Thursday",week);...
is there any way to do this without using string.h?
dyofwk = get_julian_day(1, month, year);
if (dyofwk % 7 == 0) week = "Monday";
else if (dyofwk % 7 == 1) week = "Tuesday";
else if (dyofwk % 7 == 2) week = "Wednesday";
else if (dyofwk % 7 == 3)...
Wow. I see exactly what is wrong now. Thank you for all your help.
#include<stdio.h>
#include<stdlib.h>
int main(void){
int car, choice, mchoice;
That loop is to generate a number other than the car and the persons choice, not respond with an answer. I am not sure how that if else logic would work for this. Can you elaborate?
this for statement is supposed to return a number other than one, but will always return one, showing that it is not getting past the first try i believe. I changed this statement multiple times to...
The PI declaration was what was wrong with it, my syntax after the change of the declaration was fine. Thank you.
Expression Syntax, Floating point error and Statement missing ";"
The line is currently:
area = (PI*(d_gasket*d_gasket-d_hole*d_hole))/4.0;
It keeps saying expression syntax.
The equation is to find the surface area for one side of the gasket. It is the difference between d_gasket and d_hole, both of which need to be squared before...
#include <stdio.h>
int main(void)
{
double d_gasket, d_hole, area;
printf("Gasket Area Program Started.");
#define PI = 3.14159265;
printf("\n Enter the diameter of the gasket.");...
It keeps saying expression syntax.
The equation is to find the surface area for one side of the gasket. It is the difference between d_gasket and d_hole, both of which need to be squared before...
area = PI*(d_gasket*d_gasket-d_hole*d_hole)/4.0
is the line from my program. I changed it to multiplying by itself because using any other operator would generate an error. I tried moving and...