“In Unix, everything is a file.”
And this is true also for networks. Of course you won’t learn socket programing just with this example, but it shows how to create a socket, connect, send and recieve data, and close it, is that simple.
I’ll be making a nice tutorial on network programing lather, for now, the code:
(more…)
Iced Earth - Framing Armageddon

Songs:
1.) Overture
2.) Something Wicked (Part 1)
3.) Invasion
4.) Motivation of Man
5.) Setian Massacre
6.) A Charge to Keep
7.) Reflections
8.) Ten Thousand Strong
9.) Execution
10.) Order of the Rose
11.) Cataclysm
12.) The Clouding
13.) Infiltrate and Assimilate
14.) Retribution Through the Ages
15.) Something Wicked (Part 2)
16.) The Domino Decree
17.) Framing Armageddon
18.) When Stars Collide (Born is He)
19.) The Awakening
(more…)
Uma das coisas mais básicas em programação, é a utilização de uma lista ligada para armazenar dados. O único grande problema da lista ligada, são os famigerados ponteiros.
Ponteiros
Por incrível que pareça, ponteiros são extremamente simples, sua teoria pelo menos.
Ponteiros nada mais são do que apontadores para endereços de memória. Por exemplo, digamos que queremos uma função que receba um vetor de inteiros, altere de alguma forma, e retorne o mesmo vetor, como fazer?
Essa é uma situação bem típica, onde a utilização de ponteiros vem a calhar, vamos mostrar um código, e depois explicar aos poucos.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#define MAX 10
int *modifica(int *v, int n){
unsigned int i = 0;
for(i=0;i<n;i++){
v[i]=10;
}
return v;
}
int main(void){
int *vetor = NULL;
if((vetor=malloc(sizeof(int)*MAX))==NULL){
perror(”malloc”);
return errno;
}
memset(vetor,’\0′,sizeof(int)*MAX);
vetor=modifica(vetor,MAX);
free(vetor);
vetor=NULL;
return 0;
}
Vamos explicar o código aos poucos. (more…)
Hello everybody, yes, I’m back with the website, now I have some code to show, and I’ll gradually explain my final thesis which I’m making for the university of Computer Science here in Mackenzie. Posts will be both in English and in Portuguese, it will depend on my mood. (Tutorials will always be in Portuguese)
Since I still have to use windows some times, this blog may be down some times, but it will be up again in no time.
Hope I can see all of your comments here.