« first day (474 days earlier)      last day (4465 days later) » 

2:00 AM
The only time I was forced to use C for a class was during a reverse engineering project...
 
what is reverse engineering?
breaking things down?
 
That and a memory allocator project - that we weren't allowed any C++.
reverse engineering source code from a binary
 
we haven't learn memory allocation yet. But it is on syllabus.
there is no "create a new room" at the room list. Is it because I don't have enough Reputation?
 
dang need 71 more
 
2:07 AM
@LearningC Damn, you're doing C and you still haven't heard about memory allocation?
 
@EtiennedeMartel not yet. well there was mention of it but not thought yet.
they say that is where C becomes powerful
 
Yeah, it's also where you can slice your leg off.
 
lol
pointers right?
 
@EtiennedeMartel You can slice you leg off in both C and C++.
 
No more playing Dota for me... Sucks that I'll be glued to my keyboard for the rest of the semester.
 
2:11 AM
Memory allocation = power?
 
You get to control the computer if you control their memory
 
Just like people.
 
When you guys say memory is that the hard drive or the RAM?
 
People just want to be free()!
 
that what she said...
 
2:17 AM
@LearningC Dota sucks anyway
 
@DeadMG what about dota2?
 
never played it, but if it resembles the original's gameplay, then it at least resembles a giant pile of suck
 
lol
 
and I find it hard to imagine how you can resemble a giant pile of suck without being a giant pile of suck
 
You could be a giant pile of awesome wearing a giant pile of suck costume.
You know, for Halloween, or something.
 
2:19 AM
lol
 
During February?
 
so i gotta have to use the function idelete to free up memory
but i dont know when to call it :(
 
that's what smart pointers are for
they free memory for you
very safe, very reliable, reduces code a ot
 
For programmers who don't know when to free memory? sweet
 
int main() { std::unique_ptr<int> x(new int); } // no leak!
 
Xeo
2:25 AM
@DeadMG and not usable in C
 
@renatofernandes Oh, there's an idelete? Then yes. If you call that, valgrind should report no leaks.
 
oh, when he said idelete I figured it was just a typo for delete
wasn't it the other guy who had to work in C?
anyway, if you work in C then I have little sympathy, unless someone else made you do it
 
It took me a while to understand there were two people having trouble with scanf in C. Their gravatar is even similar.
 
yes
hey robot, I could use a hand with somethin
 
Xeo
@DeadMG Patting your head?
 
2:27 AM
no
 
i tried putting idelete in various places but i still get the error,
int main(void){
    int number;
    ilist x = iempty();
    idelete(x);
    while (1 == scanf("%d",&number)) {
       x = icons(number, x);
       idelete(x);

    }
    while(!iempty_huh(x)){
    printf("%d\n",ifirst(x));
    x = irest(x);
    idelete(x);
    }

    return 0;
 
You should only delete the list when you're done with it.
 
actually, never mind
 
@DeadMG What? Fixed it by asking?
 
no, I decided that I had more immediate problems
 
2:29 AM
Does anyone have a spare minute to compile and time some simple code under GCC? and if someone has MSVC++ to time it there as well?... MS guy who promised to do it abandoned me...
 
so just before i return 0?
 
Ah. Ok. So I can go back to my comic. It's going to be either awesome, or a failboat.
 
ok
 
@renato, that code looks like pandoras box. The sooner your realize it's a unsolvable mystery, the better you will end it.
 
2:32 AM
don't panic
 
@AzzA I think ideone runs on GCC.
 
That's true, but I wonder about timing tights loops on ideone.com... seems like a rude thing to do...
plus, I'm not sure the server CPUs load is constant throughout the execution...
 
ok renato, you already solved your problem as I can see
 
Wait, what are you trying to do?
 
but lets go it together
it will be much funnier
OK, first observe the flow of the code
what do you notice?
int main(void){
int number;
ilist x = iempty();
idelete(x);
while (1 == scanf("%d",&number)) {
x = icons(number, x);
idelete(x);

}
while(!iempty_huh(x)){
printf("%d\n",ifirst(x));
x = irest(x);
idelete(x);
}

return 0;
 
 
i have to use idelete to when i've made a list
 
It is unusual to have so many idelete(x), isnt it?
 
The MS guy said he's gonna recompile it and disappeared...
 
kayy maybe tht code was wrong but ive tried putting idelete everywhere
i tried a varity of cases? :(
 
ok, you will use, but lets go step by step, because I can feel you have no clue where problem lies, eventhough it's infront of you.
 
2:37 AM
yeaa i feel like tht too
 
when you delete something, you do it usually at the end, right?
 
I'm willing to put up a small bounty as well.. sniff
 
so before return 0?
 
I don't know
 
Xeo
@RMartinho: Here's something for your memory comics: stackoverflow.com/q/9106371/500104
 
2:37 AM
yet, lets go step by step.
 
@renatofernandes yes, and just in case - put one after return 0; as well
 
@Xeo Yeah, I saw that, and thought "Oh no, there's no way I'm answering that crap."
 
i tried before and after still error
okayy back to step by step
 
do you know what is while loop?
and when is used such?
 
yea i know what a while loop is it runs a loop until its condition is false
 
mhm
btw dzek do u know the functions my school has provided for me?
 
You, people, have no compassion -.-...
 
not you, renato :)
 
Every function is the same or similar to some existing function. By reading name of the function I concluded about what is it .
 
2:42 AM
oh okay :)
alrite
 
First loop is okay for you.
 
Could you tell me why is that? I will tell you if you don't know, but use logic to conclude it
 
You only have one list, right?
 
Are you here?
 
2:44 AM
So only one idelete.
 
its okay because it runs until i end it (by control-d)
yea one list
 
You need to use the list until the end of the second loop, so you can't idelete it before that.
 
im just confused where to call idelete
 
@RMartinhoFernandes , we are here to teach him something, not to do his homework.
lol
 
i appreaciate it dzek lol
i want to learn anyway
 
2:45 AM
while (1 == scanf("%d",&number)) {
x = icons(number, x);
idelete(x);

}
 
no thts wrong
i didnt mean to call i delete in there cause i didnt finish making the list
 
it says read input from the cmd until there is no input ( left blank )
but could you tell me why is that so?
 
tell you why it works like tht? O_O
 
yes, can you read a code?
What does 1 present?
1 ( true ) right?
 
2:48 AM
yea
 
OK :)
 
so when we hit control-d its false thus break loop?
 
so you have learned it
what control-d?
you mean %d?
 
im progrmmin on a linux, so it basically gathers information until i press it
control-d kinda ends scanf i assume?
 
I see. :)
But you can debug any programm with that whenever you like
it doesn't just apply on this one. ;)
 
Xeo
2:50 AM
@renatofernandes ctrl-d is "end of input"
 
okay.... o-o
 
lets go back to assignment
scanf("%d",&number)
 
@DzekTrek Not really. Here he's using 1 to test if scanf read one record. It's not meaning true, it's meaning one.
 
@RMartinhoFernandes , I hoped someone will answer. :)
when there is no blank input, do the action in the loop
 
2:53 AM
im so lost now :S
KAYY BACk to me dubuggin my code :)
 
:) I can simply see it.
OK, I have done your assignment here
 
mhm ... teach me ? :)
assignement as in tht question or the whole thing? lol
 
but before I give it to you, I want to know how come you have no clue? :)
the whole thing
while(!iempty_huh(x)) - this iterates through x, right?
 
dammn i wish i could think like programmers like you
yes
so i shouldnt use idelete since i still need the list?
 
Right.
But you need to do it before the program ends.
 
2:59 AM
i tried before return 0 and after ... still error :S
 

« first day (474 days earlier)      last day (4465 days later) »