lol ok thanks brewbuck and mcnamara, it's fixed !
Type: Posts; User: ReggieBE
lol ok thanks brewbuck and mcnamara, it's fixed !
Yes, that was the problem, thnx
But it's not removing the file though .. is there any way to do this without xargx ? Cause it's not installed :\
Hi,
I'm trying to remove the oldest file (whenever there's 14 or more):
FILECOUNT=`ls | wc -l`;
if [ $FILECOUNT > 14 ]
then
cd "$PATH" && ls -tr | head -n 1 | xargx rm -f;
Hi,
I'm trying to translate some C code to java and trying to understand some code so I could write it. Now I'm not a C expert, so don't laugh at me ;)
I'm trying to figure out what the line...
I'm trying to find some information about making a nice GUI in c. I'd like to make frames and align my text and so on.
Anyone knows a good resource ?
Yeah, I'm using Dev-C++ and he gives me a hard time aligning sometimes :s
@Dragon: I tried your code but it still crashes :s
EDIT: BTW Any other suggestions for a c ide ?
Hmm when I run my code in debug mode. Step by Step, it works. But the moment I just run it, it crashes:
int main(void)
{
QUEST* qp = NULL;
int i,j=0;
i = get_questions(&qp,...
@Dragon: why are you using memcpy ? Isn't this for strings ?
(Sorry for asking so many questions, but I have to be able to explain every single line for school)
@Salem: What do you mean by checking the result ? Isn't he always going to get the size of the struct out of the file ?
UPDATE: Kay got it :o
ARgh sorry, I forgot I changed it to fixed sizes :D
Hi,
I'm trying to read out some structs I saved in a binary file.
Can I just fread(struct, sizeof(struct)... ?
I can't find any info about that..
This crashes (saving to linked list):
//...
I'm experiencing something strange here:
In the code below I malloced filename to the strlen of the category name, + 4 to add ".dat". When I do that I get stuffing in my string.
Now my question:...
Kay found it. Forgot to add \0 to the last address in substr() :D
Oh ok thnx !
Just one question .. I get the categories listed, but some junk comes along with it like "Categoryfile=c:\java\.."
I checked ds->d_name. That's not it. Then I declared tmp with = {...
What's t ? char** ?
@Salem: I did, but it didn't work when I just set cat = NULL .. when I malloced it it worked. Why is that ?
EDIT: Oooooh ok, I did cat** = NULL. But I have to stel cat* to NULL also, right ?
Ok got it. Forgot to malloc cat the first time.
Working code:
char** get_categories(void)
{
DIR* dp = NULL;
struct dirent* ds;
char** cat = NULL;
This is what I have now:
char** get_categories(void)
{
DIR* dp = NULL;
struct dirent* ds;
char** cat = NULL;
int i=1;
dp = opendir("rubrieken/");
Thnx for helping me out !
realloc returns void, so I guess there's no use to assign it to a variable ?
I guess the error has something to do with the realloc. Can't debug, Dev-C++ refuses ...
I'm trying to save filenames into an array of chars.
My code seems incorrect, but can't figure out what's wrong :\
char** get_categories(void)
{
DIR* dp;
struct dirent* ds;
...
Ok I have another problem now. I tried to save the struct one by one. And this is what I get:
-----------------------
DIt is vraag 1 \QTSystem\;C:\Program Files\Java\jdk1.5.0_03\bin;...
YES ! That did it :p thnx !
Ok, I changed head to &head and also q into &q.
These are the errors I get:
makequiz2.c: In function `make_quiz':
makequiz2.c:46: warning: assignment from incompatible pointer type
...
Ok I'm getting slightly insane here.
Before I begin to ask my question I will give you some code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "misc.h"