So could I malloc the space from within my stack initialization function? Would that be the best route, or should I allocate the space before the stack gets initialized?
Here's the function:
...
Type: Posts; User: alpine
So could I malloc the space from within my stack initialization function? Would that be the best route, or should I allocate the space before the stack gets initialized?
Here's the function:
...
I need to create a stack, but the size of the stack needs to be scanned in from an input file. How do I go about declaring the structure for the stack?
struct stack {
int items[SIZE];
int...
So currently I have a function that permutes a given word, for example:
If you input CAT, it gives you
CAT
CTA
ACT
ATC
TCA
TAC
Here's what i've got so far:
int r1, r2, x, y, hyp, i;
char grid [30][30];
printf("Enter the outer radius of your wheel?\n");
scanf("%d", &r1);
printf("Enter the inner radius of your...
#include <stdio.h>
void a(int num);
void b(int num);
int main() {
a(6);
return 0;
}
So I've been tasked with printing out a graph that shows gas mileage for 5 minute intervals during a trip based on a file the user directs you to. Here's what mine currently prints out:
95 ...