Yeah, works perfect.
Thanks.
Type: Posts; User: Sinery
Yeah, works perfect.
Thanks.
Hello strangers,
I'm having an issue coming up with an if() statement to check if a word match the one in the value of a pointer's address.
So far the best I've come up with only matches the...
A whole lot of crap, essentially reading values into n, n2, ArraySize, reserve memory for struct array, get a pointer for the array, and get the pointer to fly all over the place to eventually count...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct MyStruct
{
int n;
char n2[32];
};
I have been using strcpy earlier, but I ended up not using it because I couldn't figure out how to load in a value to it.
Instead I used:
scanf("%s", &ArrayPointer[0].n2);
I don't know if...
Thank you very much, I do not have words enough to describe my appreciation.
However, I am struggling to implement a char array into your program.
#include <stdio.h>
#include <stdlib.h>
I am currently using a help pointer for the sole purpose to be allowed to use * and it is working just fine.
It's a bit dirty, but there is nothing in my task saying I may not do it.
int...
Frankly, this is the first time I'm using a struct and there is little instruction on how I shall use it, so I have no idea if I am utilizing it as I should.
The task I have is required to have a pointer as a return value, and then use a pointer that is pointing on the same address as a parameter to another function where it will go through the array.
...
Yeah, I wouldn't be throwing a pointer all around the place if I wasn't instructed to do just that.
However, the pointer works just as it ought to all the way except at the place I showed above....
I'll give you the whole life length of each.
int ArraySize = 3;
int *ReturnedArrayPointer = 0;
int Stock(ArraySize)
{
struct MyStruct *ArrayPointer;
Putting * in the function parameter gives me "Unamned prototyped parameters not allowed when body is present." error.
Yeah, that's when I get the Operand of '*' must be of a pointer error.
I am unable to use * to acquire the value of the address that ReturnedArrayPointer has.
The comments in the code should explain in more clearly.
#include"Header.h"
/* These are in Header.h...
Sorry about that, did search for a code tag but must have missed it.
About the parameter, yeah I was testing how my memory responded to me setting it to different numbers manually like that but...
13861
I have no idea why my pointer skips over the colour addresses, it jumps to the next size address when I use Pointer++.
I have tried changing the the char array to 4 bytes instead of 32 and...