Thanks a lot!
In order to save RAM memory I suppose one should use malloc. Is that a standard approach for dealing with values? When should one use regular variables and when should one use...
Type: Posts; User: sababa.sababa
Thanks a lot!
In order to save RAM memory I suppose one should use malloc. Is that a standard approach for dealing with values? When should one use regular variables and when should one use...
I've tried different ways but only this work with my gcc-compiler:
#include <stdio.h>
int Input(){
int something;
scanf("%d", &something);
return something;
}
I upgraded the code, but it doesn't want to compile:
#include <stdio.h>
int Calc(int x, int y, int*zpointer; int*apointer){
scanf("%d", &x);
scanf("%d", &y);
&zpointer=y+x;...
Thanks! I tried both methods, now with passing the values of two varibales, but get wrong output again:
returning method:
#include <stdio.h>
int Calc(int x, int y){
int z;
int a;...
Hi all!
As a newbie I try to dig into every basic problem to learn the proper way of programming, instead of make a work-around. My question is: Why is the choice-variable not passed in a proper...
Thanks!
in theAI:
int *theAI(int *x, int *y){
*x = ((rand() %300)+20);
*y = ((rand() %300)+20);
return x, y;
}
OK, so now the code looks like this:
struct foo
{
int x;
int y;
char* pic;
};
Thanks! Now it works! But is it a good or bad idea to make "baz" global, like this:
#include<stdio.h>
struct foo
{
char *bar;
};
struct foo baz;
Thanks, but when I change the code to this:
struct The
{
int x;
int y;
char* pic;
} rabbit;
Hi,
I try to load a sprite map in this way:
struct The
{
int x;
int y;
char[10] pic;
Now I've debugged deeper. The bug could be deduced to this file:
dfm sourcecode, iwc_8c-source.html, 0.99.9
and the line that causes the bug is this:
...
Yes!!! I solved it! The bug was in this file:
dfm sourcecode, timer_8c-source.html, 0.99.9
...and this code caused the bug:
SendWindow(GetMoveWindow(),UPDATE_LIGHT);
The solution was to...
...by the way, here is the entire source code for the program I'm trying to fix:
dfm sourcecode, main_8c-source.html, 0.99.9
I really like this file manager, but it crashes after about a minute...
Hi,
I try to adapt some good old code to the environment of today. Further I've found that XNextEvent blocks the program I'm trying to debug. I read that this function worked in another way in the...
Thanks a lot for all the answers and comments!
MK27, your explanation is great.
...so a good rule of thumb would be to put the function definitions in the .c files and all other stuff in the .h files. But why should I declare the function before I define it? Isn't it enough with...
Now I've studied some source code, and it seems that there're only void functions in .c files (except the main function) and returning functions in .h files.
Expat is what I searched for.
...
Hi all!
I've two n00b questions concerning the praxis of writing source code:
1. I've understood that the source files can either have the file extension .h or .c, but when should I use which...
I'm not sure if I understand your problem, but a sketch that I'd suggest is:
#include <stdio.h>
#include <string.h>
fgets( ....read the line....)
int i;
A good tip:
Show us the code...
Thanks ZuK!
Hurray! It's working the way I want... I made a workaround, but I'm really currious why the loop in the previous post didn't work. Here's the new code:
void theloop()
{
char...
I made a separate function for checking the ,.() signs, but when askword is bigger than three letters, then save turns 0 even though wordtwo should be equal to wordask:
void theloop()
{...
I changed the code to this, but it doesn't work the way I want - the second strtok is not recognized.
struct node* Build(struct node* head)
{
p = head->next;
while(p->next)
{
I solved the problem!
It didn't work because I tried to check the same variable two times with the strtok commands. The solution is that I made one loop of the second and third loop (see the first...