Awesome, cheers anon
Type: Posts; User: Rad_Turnip
Awesome, cheers anon
Thanks Mats,
I decided to go with adding the two together in a struct and returning that. However i am now struggling with the memory allocation of the struct i have created
typedef struct...
Hi there,
I was just wondering if it was possible to return two structs of the same type from a function.
i.e. if the case was struct ingedients, something like:
return cake, biscuit;
...
Hey hey,
I'm wanting to create an ADT that is an array (52 in size) of another ADT structure. The other ADT structure is a card and the array i am trying to create is the deck of cards. However...
Crazy, all those errors were attributed to the wrongly initialized array.
Cheers Quzah
-Nick
TextBuffer is meant to be a global array that i can change from all the functions i write. I have written it up the same way as with other globals but this time i got errors.
Hi
thanks for the reply
I'm not at my the computer with the code on it right now so i can't test my guess.
I assume the problem is solved by passing the pointer *c instead of the char itself...
I was trying to write myself a little c file to test scroll_str function. The setup for this one is basically the same as all the others i used in testing my code but this one gives a heap off...
From the code below i get the following warning message from the display_char function.
warning: passing arg 1 of 'valid char' makes pointer to integer without a cast
void display_char(char...
*sigh* it is always a stupid mistake. Thanks a lot for your help.
-Nick
Hi,
I have been trying to get my head around arrays, though i understood it but have tripped over again with multidimensional arrays.
int main(int argc, char *argv[])
{
int...
Noted
Cheers,
-Nick
Thanks for your help guys.
I wrote out a quick program to test your advise before I attempted to implement it in my program.
#include <stdio.h>
#include <stdlib.h>
void func1();
int...
Cool, so the return statement in local_function2 would be...
return array;
would this direct the "filled in" array back to local_function1?
Thanks again Salem,
-Nick
Hey all,
I am having trouble with getting an array from a local function, for a local function. So i have....
int main(int argc, char *argv)
{ code }
int local_function1()
{ ...
Wicked Awesome
Thanks, i had changed those for because it got rid of a segmentation fault a while back but forgot to right things again.
Cheers Salem,
-Nick
I use the GNOME Terminal 2.7.3 in a Linux system and compile using the command line gcc play.c -Wall -o play
thanks to everyone for their input so far
-Nick
Thanks for your reply.
Ok, that was a poorly thought out example. Maybe that isn't the problem.
I tried to make an example because it'd take ages to explain what the entire purpose of this code...
Hey Hey,
int i;
int number[100];
int placeHolder = 0;
for(i = 0; i < 10; i++)
{
number[placeHolder] = i;
placeHolder++;
Yay for Quzah :D
Cheers man,
-Nick
Thanks, that was just what i was looking for. However i have now run into an all new problem that I am having trouble dealing with.
#include <stdio.h>
#include <stdlib.h>
/* Prototypes of...
Hi fellow programmers ;)
I have been trying to figure out how to use the argc and argv data. I have a main function that looks like
int main(int argc, char *argv[])
{
int num_roads =...
Ok i get it now, have tested what the FAQ say on some really short code i made. Its the code that i was playing with (listed above) that is somehow wrong.
-Nick
sigh, ok i still dont get it. This is a function to find the range of values in an array of integers...it is someone elses code that i am using to teach myself about arrays.
#include <stdio.h>...
Cheers Quzah :D
Had trouble searching up the problem with my limited knowledge of terminology.
-Nick