+//aula 36
+int main(void)
+{
+ int vetor[10] = {6,4,1,9,8,7,0,5,7,3};
+ int i;
+ void ordemCrescente(int vetor[]); // 1-vetor (nome) 2- tamanho (nº inteiro dos membros que existem..)
+ return 0;
+}
+// criar uma função que ordene os vetores... uma variável que lê estes elementos..
+
diff --git a/bookmarks.html b/bookmarks.html
new file mode 100644
index 0000000..3790551
--- /dev/null
+++ b/bookmarks.html
@@ -0,0 +1,61 @@
+
+
+
+Bookmarks
+Bookmarks Menu
+
+
+
- Recently Bookmarked
+
- Recent Tags
+
+ Ubuntu and Free Software links
+ - Information and resources about Ubuntu, Debian and Free Software in general
+
+
- Ubuntu
+
- Ubuntu Wiki (community-edited website)
+
- Make a Support Request to the Ubuntu Community
+
- Debian (Ubuntu is based on Debian)
+
- Ubuntu One - The personal cloud that brings your digital life together
+
+
Mozilla Firefox
+
+
- Help and Tutorials
+
- Customize Firefox
+
- Get Involved
+
- About Us
+
+
Bookmarks Toolbar
+- Add bookmarks to this folder to see them displayed on the Bookmarks Toolbar
+
+
- Most Visited
+
- Tempo em Mirandela - Previsão para 14 dias
+
- Getting Started
+
ip
+
+
- c - warning: format ‘%d’ expects type ‘int *’, but argument 2 has type ‘int’ - Stack Overflow
+
+
+
Unsorted Bookmarks
+
+
- Fernando Silva - Teaching
+
- Your description goes here
+
- Configuring sound in Linux | TechRepublic
+
- Configuring sound in Linux can be a real hassle if you don't know the tools. One sound configuration tool that's been around for quite some time is sn
+
- TechRepublic - A Resource for IT Professionals
+
- TechRepublic helps IT decision-makers identify technologies and strategies to empower workers and streamline business processes. The site delivers a unique blend of original content by IT professionals, peer-to-peer advice from the largest community of IT leaders on the Web, and a vast library of professional resources from the leading vendors in the IT industry. TechRepublic features blogs, community forums, vendor white papers, software downloads, Webcasts, and research.
+
- Como encadernar um livro em casa - YouTube
+
- Passo a passo de uma encadernação de livro caseira utilizando cola quente
+
- Microsoft TechNet Home Page
+
- TechNet is the home for all resources and tools designed to help IT professionals succeed with Microsoft products and technologies.
+
- Jogada do Mês
+
- Notícias do Jogada do Mes
+
- Centro de Informática - FCUP
+
- Favoritus Bookmarks Online
+
- Favoritus Bookmarks Online
+
- SASUP - Pavilhão Luís Falcão
+
- Festas Universitárias Porto
+
- Encontra facilmente a hora, local, line up e preço das melhoras festas universitárias do Porto. E muito mais... Live your life!
+
+
diff --git a/bool b/bool
new file mode 100644
index 0000000..fdc100f
Binary files /dev/null and b/bool differ
diff --git a/boolean b/boolean
new file mode 100644
index 0000000..0cb1328
Binary files /dev/null and b/boolean differ
diff --git a/boolean.c b/boolean.c
new file mode 100644
index 0000000..f43166d
--- /dev/null
+++ b/boolean.c
@@ -0,0 +1,13 @@
+#include
+#include
+int main()
+{
+ int i=9-1;
+ int c;
+ while (i)
+ printf("\n%d",--i);
+ c=getchar();
+ printf("O carater proveniente da função é:%d e \t%c\v",c,(char) c);
+ bool variavelBool=true;
+ return printf("%i\n",variavelBool);
+}
diff --git a/bye.c b/bye.c
new file mode 100644
index 0000000..097b636
--- /dev/null
+++ b/bye.c
@@ -0,0 +1,6 @@
+#include
+int bye()
+{
+puts ("bye");
+return 0;
+}
diff --git a/c01p01 b/c01p01
new file mode 100644
index 0000000..944aee7
Binary files /dev/null and b/c01p01 differ
diff --git a/c01p01.c b/c01p01.c
new file mode 100644
index 0000000..f84998f
--- /dev/null
+++ b/c01p01.c
@@ -0,0 +1 @@
+main (){}
diff --git a/c01p01.c~ b/c01p01.c~
new file mode 100644
index 0000000..976c7aa
--- /dev/null
+++ b/c01p01.c~
@@ -0,0 +1,3 @@
+main ()
+{
+}
diff --git a/c01p02 b/c01p02
new file mode 100644
index 0000000..9efe3d3
Binary files /dev/null and b/c01p02 differ
diff --git a/c01p02.c b/c01p02.c
new file mode 100644
index 0000000..45b49fd
--- /dev/null
+++ b/c01p02.c
@@ -0,0 +1,7 @@
+#include
+
+main ()
+{int x=39 , y =32;
+printf ("He%%llo \a" ); printf("\n");
+scanf("%d %d",&x,&y);
+printf("W\borl\n\bd");} /* estar \7 ou \a e igual e resultam em 1 sinal sonoro independete do numero*/
diff --git a/c02e017 b/c02e017
new file mode 100644
index 0000000..e7608c0
Binary files /dev/null and b/c02e017 differ
diff --git a/c02e017.c b/c02e017.c
new file mode 100644
index 0000000..ea7dc85
--- /dev/null
+++ b/c02e017.c
@@ -0,0 +1,13 @@
+#include
+main ()
+{int a,b;
+ printf ("Defina os seus dois inteiros para efectuar as operações\n");
+scanf("%d""%d",&a,&b);
+printf("A soma das constantes é: %d+%d=%d\n",b,a,a+b);
+ printf(" Da subtração a-b resulta: %d-%d=%d\n",a,b,a-b);
+printf("Da subtração resulta: %d-%d=%d\n",b,a,b-a);
+printf(" Da \"subtração\" -b +a resulta : %d-%d=%d\n",b,a,-b+a);
+printf("Da multiplicação resulta: %d*%d=%d\n",b,a,b*a);
+printf("o quociente é: %d: ou / %d=%d\n",b,a,b/a);
+printf("Do resto resulta: %d%%%d=%d\n",b,a,b%a);
+}
diff --git a/c02e017ASPAS b/c02e017ASPAS
new file mode 100644
index 0000000..0ea8736
Binary files /dev/null and b/c02e017ASPAS differ
diff --git a/c02e018 b/c02e018
new file mode 100644
index 0000000..aef7b00
Binary files /dev/null and b/c02e018 differ
diff --git a/c02e018.c b/c02e018.c
new file mode 100644
index 0000000..0b209c5
--- /dev/null
+++ b/c02e018.c
@@ -0,0 +1,9 @@
+#include
+main() {
+ int tempo;/*ou do tipo float*/
+ printf("Introduz o numero de segundos em questão\n");
+ scanf("%d",&tempo);
+ printf("o tempo decorrido em horas: %d\v", (tempo/60)/60);
+ printf("o tempo decorrido em minutos %d \n",tempo/60);
+ printf("conversão a segundos dá: %d \b\v",tempo);
+}
diff --git a/c02e018R b/c02e018R
new file mode 100644
index 0000000..d43d94e
Binary files /dev/null and b/c02e018R differ
diff --git a/c02e018R.c b/c02e018R.c
new file mode 100644
index 0000000..1fa6362
--- /dev/null
+++ b/c02e018R.c
@@ -0,0 +1,11 @@
+#include
+main(){
+long int n_segundos;
+printf("informação de escrever o numero\b ;\n")
+scanf("%ld",&n_segundos);
+printf("o numeros de horas:%ld\voi\n",n_segundos/(60*60));
+printf("na parte do minutos é %ld\r\v\r",(n_segundos%3600)/60);/*1hora=60min*/
+printf("os sobrantes segundos:%ld\n",n_segundos%60);
+
+printf("O tempo com todos os parametros é:%ldhoras %ldminutos e %ldsegundos",n_segundos/(60*60),(n_segundos%3600)/60,(n_segundos%60)%60);
+}
diff --git a/c02e019 b/c02e019
new file mode 100644
index 0000000..1447e94
Binary files /dev/null and b/c02e019 differ
diff --git a/c02e019.c b/c02e019.c
new file mode 100644
index 0000000..9485b10
--- /dev/null
+++ b/c02e019.c
@@ -0,0 +1,10 @@
+#include
+main() {
+ float n;
+ printf("escolha o seu real \voi\bhuashuash\n\b\bboi");
+ scanf("%f",&n);
+ printf(" a parte inteira do n é %d\n",(int) n);
+ printf("a parte decimal do numero é igual %f\n",n-(int) n);
+ /* ou n-((int) n) ou real*/
+ }
+
diff --git a/c02e03 b/c02e03
new file mode 100644
index 0000000..10a42fb
Binary files /dev/null and b/c02e03 differ
diff --git a/c02e03.c b/c02e03.c
new file mode 100644
index 0000000..49afa1a
--- /dev/null
+++ b/c02e03.c
@@ -0,0 +1,9 @@
+#include
+main()
+{
+int n1,n2;
+float n3;
+printf("Introduza 2 Nºs:\n");
+scanf("%d%f",&n1,&n3);
+printf("o número surgido foi %f\n",n1+n3);
+}
diff --git a/c02e04 b/c02e04
new file mode 100644
index 0000000..be64dbf
Binary files /dev/null and b/c02e04 differ
diff --git a/c02e04.c b/c02e04.c
new file mode 100644
index 0000000..403c84a
--- /dev/null
+++ b/c02e04.c
@@ -0,0 +1,5 @@
+#include
+main()
+{
+printf("O Tamanho de um inteiro = %ld bits\n", sizeof(int)*8);
+}
diff --git a/c02e05.c b/c02e05.c
new file mode 100644
index 0000000..ee22bb5
--- /dev/null
+++ b/c02e05.c
@@ -0,0 +1,11 @@
+#include
+main()
+{
+printf("O Tamanho de um char = %d Bytes\n", sizeof(char));
+
+printf("O Tamanho \"em Bytes*8\" de um inteiro = %ld bits\n", sizeof(int)*8);
+
+printf("O Tamanho em Bytes de um inteiro = %ld bits\n", sizeof(int)*8);
+printf("O Tamanho em Bits de um float = %ld \n", sizeof(float)*8);
+printf("O Tamanho em Bytes de um double = %ld \n", sizeof(double)
+}
diff --git a/c02e16 b/c02e16
new file mode 100644
index 0000000..1a9378b
Binary files /dev/null and b/c02e16 differ
diff --git a/c02e16.c b/c02e16.c
new file mode 100644
index 0000000..d53308d
--- /dev/null
+++ b/c02e16.c
@@ -0,0 +1,7 @@
+#include /*Má implementação*/
+main()
+{ char ch1 = 'd',ch2 = 'K';/* o valor inicializado não interfere nos print's do programa*/
+ printf("Introduza um Inteiro:\t ");
+ scanf("%d",&ch2);
+ printf("O valor de ch1 = '%c' e ch2 ='%c'\n",ch1,ch2);
+}
diff --git a/c02eo4 b/c02eo4
new file mode 100644
index 0000000..fdb7e65
Binary files /dev/null and b/c02eo4 differ
diff --git a/c02p013 b/c02p013
new file mode 100644
index 0000000..b997a4b
Binary files /dev/null and b/c02p013 differ
diff --git a/c02p013.c b/c02p013.c
new file mode 100644
index 0000000..03b17cd
--- /dev/null
+++ b/c02p013.c
@@ -0,0 +1,10 @@
+#include
+main() {
+char ch1,ch2;
+printf("\tIntroduza um carater\n");
+scanf("%c",&ch1);
+printf("Introduza um 2ºcarater\n");
+fflush(stdin);
+scanf(" %c",&ch2);
+printf("Os carateres associados as variáveis são: %c e %c\n",ch1,ch2);
+}
diff --git a/c02p014 b/c02p014
new file mode 100644
index 0000000..1da1f39
Binary files /dev/null and b/c02p014 differ
diff --git a/c02p12 b/c02p12
new file mode 100644
index 0000000..97d43a6
Binary files /dev/null and b/c02p12 differ
diff --git a/c02p12.c b/c02p12.c
new file mode 100644
index 0000000..697a225
--- /dev/null
+++ b/c02p12.c
@@ -0,0 +1,9 @@
+#include
+main() {
+char ch1,ch2;
+printf("\tIntroduza um carater\n");
+scanf("%c",&ch1);
+printf("Introduza um 2ºcarater\n");
+scanf("%c",&ch2);
+printf("Os carateres associados as variáveis são: %c e %c\n",ch1,ch2);
+}
diff --git a/c1e3 b/c1e3
new file mode 100644
index 0000000..1417d47
Binary files /dev/null and b/c1e3 differ
diff --git a/c1e3.c b/c1e3.c
new file mode 100644
index 0000000..b18ee81
--- /dev/null
+++ b/c1e3.c
@@ -0,0 +1,6 @@
+#include
+
+int main(int argc, char *argv[])
+ printf("Hello!\n");
+ return 12; // código de terminação / ver no terminal com: echo $? COLOQUEI o numero -677 91
+}
diff --git a/c1e3.c~ b/c1e3.c~
new file mode 100644
index 0000000..18211c6
--- /dev/null
+++ b/c1e3.c~
@@ -0,0 +1,6 @@
+#include
+
+int main() {
+ printf("Hello!\n");
+ return 12; // código de terminação / ver no terminal com: echo $?
+}
diff --git a/c1e4b b/c1e4b
new file mode 100644
index 0000000..176df63
Binary files /dev/null and b/c1e4b differ
diff --git a/c1e4b.c b/c1e4b.c
new file mode 100644
index 0000000..b6e1c5f
--- /dev/null
+++ b/c1e4b.c
@@ -0,0 +1,20 @@
+#include
+#include
+
+int main(int argc, char* argv[]) { // parâmetros na linha de chamada do terminal
+ int k, nr;
+
+ if (argc != 3) { // se nr. errado de parâmetros
+ printf("Usage: %s \n", argv[0]);
+ return 1;
+ }
+ nr = atoi(argv[2]); // converter para int
+ if (nr <= 0) { // valor de inválido
+ printf("The nr of times should be greater than 0!\n");
+ return 2;
+ }
+ for (k=0; k vezes
+ printf("Hello %s!\n", argv[1]);
+ return 0;
+}
+
diff --git a/c1e4b.c~ b/c1e4b.c~
new file mode 100644
index 0000000..b6e1c5f
--- /dev/null
+++ b/c1e4b.c~
@@ -0,0 +1,20 @@
+#include
+#include
+
+int main(int argc, char* argv[]) { // parâmetros na linha de chamada do terminal
+ int k, nr;
+
+ if (argc != 3) { // se nr. errado de parâmetros
+ printf("Usage: %s \n", argv[0]);
+ return 1;
+ }
+ nr = atoi(argv[2]); // converter para int
+ if (nr <= 0) { // valor de inválido
+ printf("The nr of times should be greater than 0!\n");
+ return 2;
+ }
+ for (k=0; k vezes
+ printf("Hello %s!\n", argv[1]);
+ return 0;
+}
+
diff --git a/c1e5b b/c1e5b
new file mode 100644
index 0000000..b0016ad
Binary files /dev/null and b/c1e5b differ
diff --git a/c1e5b.c b/c1e5b.c
new file mode 100644
index 0000000..a047c30
--- /dev/null
+++ b/c1e5b.c
@@ -0,0 +1,17 @@
+#include
+#include
+
+int main(int argc, char* argv[], char* envp[]) { // acesso a variáveis de ambiente
+ int k=0;
+ char name[100];
+
+ if (argc != 1) { // invocar sem parâmetros
+ printf("Usage: %s\n", argv[0]);
+ return 1;
+ }
+ while (strncmp("USER=", envp[k], 5)!=0) // descobrir a linha que começa por "USER="
+ k++;
+ strcpy(name, &envp[k][5]); // extrair o resto da linha
+ printf("Hello %s!\n", name);
+ return 0;
+}
diff --git a/cap6e5.c b/cap6e5.c
new file mode 100644
index 0000000..faf8190
--- /dev/null
+++ b/cap6e5.c
@@ -0,0 +1,19 @@
+#import
+
+
+char * memcpy(char *dest, char *orig, int n)
+{
+ for (int i=0; i < n; i++)
+ (*dest[i]) = (*orig[i]);
+ return dest;
+}
+
+int main()
+{
+
+int vet1={'a','g','f','t','y','t','h','o','I'};
+int vet2[10];
+memcpy(vet1,vet2,4);
+memcpy(vet2,vet1,7);
+
+}
diff --git a/dica.xcf b/dica.xcf
new file mode 100644
index 0000000..9eadd60
Binary files /dev/null and b/dica.xcf differ
diff --git a/exercio6.c b/exercio6.c
new file mode 100644
index 0000000..bb71db0
--- /dev/null
+++ b/exercio6.c
@@ -0,0 +1,29 @@
+// PROGRAMA p6a.c
+#include
+#define BUF_LENGTH 256
+int main(void)
+{
+ FILE *src, *dst;
+ char buf[buf_length];
+ if ( ( src = fopen( "infile.txt", "r" ) ) == NULL )
+ {
+ exit(1)
+ }
+ if ( ( dst = fopen( "outfile.txt", "w" ) ) == NULL )
+ {
+ exit(2)
+ }
+Sistemas
+Operativos
+–
+MIEIC
+Jorge
+Silva
+ while( ( fgets( buf, MAX, src ) ) != NULL )
+ {
+ fputs( buf, dst );
+ }
+ fclose( src );
+ fclose( dst );
+ exit(0); // zero é geralmente indicativo de "sucesso"
+}
diff --git a/exercio6.c~ b/exercio6.c~
new file mode 100644
index 0000000..bb71db0
--- /dev/null
+++ b/exercio6.c~
@@ -0,0 +1,29 @@
+// PROGRAMA p6a.c
+#include
+#define BUF_LENGTH 256
+int main(void)
+{
+ FILE *src, *dst;
+ char buf[buf_length];
+ if ( ( src = fopen( "infile.txt", "r" ) ) == NULL )
+ {
+ exit(1)
+ }
+ if ( ( dst = fopen( "outfile.txt", "w" ) ) == NULL )
+ {
+ exit(2)
+ }
+Sistemas
+Operativos
+–
+MIEIC
+Jorge
+Silva
+ while( ( fgets( buf, MAX, src ) ) != NULL )
+ {
+ fputs( buf, dst );
+ }
+ fclose( src );
+ fclose( dst );
+ exit(0); // zero é geralmente indicativo de "sucesso"
+}
diff --git a/ficheiros b/ficheiros
new file mode 100644
index 0000000..6698552
Binary files /dev/null and b/ficheiros differ
diff --git a/ficheiros.c b/ficheiros.c
new file mode 100644
index 0000000..3307325
--- /dev/null
+++ b/ficheiros.c
@@ -0,0 +1,29 @@
+#import //dif. entre #include
+
+int gVariavelGlobal = 2
+;// recomenda pois ela acedido por todas as funções logo...: + fácil de identificar em programas grandes etc
+
+int main (void){
+
+ void teste(void); // só pode ser usada no main.. normalmente é a declaração é pública assim fica protected???
+
+printf("Global = %i\n", gVariavelGlobal);
+ teste();
+ teste();
+
+ return 0;
+}
+
+void teste(void){
+ int varLocalAuto = 2;
+ varLocalAuto *= 2;
+
+ static int variavelLocalEstatica = 2;
+ variavelLocalEstatica *= 2;
+
+ gVariavelGlobal *= 2;
+
+ printf("Local Automatica = %i\n", varLocalAuto );
+ printf("Local Estática = %i\n", variavelLocalEstatica );
+ printf("Global = %i\n", gVariavelGlobal); // a local age como se fosse estatica
+}
diff --git a/fprintf&scanf.c b/fprintf&scanf.c
new file mode 100644
index 0000000..6c9239f
--- /dev/null
+++ b/fprintf&scanf.c
@@ -0,0 +1,27 @@
+#include
+#include
+int main()
+{
+ FILE *p;
+ char str[80],c;
+ /* Le um nome para o arquivo a ser aberto: */
+ printf("\n\n Entre com um nome para o arquivo:\n");
+ scanf("%s", str); /* não se usa a função gets() e sim scanf dessa forma */
+ if (!(p = fopen(str,"w"))) /* Caso ocorra algum erro na abertura do arquivo..*/
+ { /* o programa aborta automaticamente */
+ printf("Erro! Impossivel abrir o arquivo!\n");
+ exit(1);
+ }
+ /* Se nao houve erro, imprime no arquivo, fecha ...*/
+ fprintf(p,"Este e um arquivo chamado(com ou sem caminho e formato):\n%s\n", str);
+ fclose(p);
+ /* abre novamente para a leitura */
+ p = fopen(str,"r");
+ while (!feof(p))
+ {
+ fscanf(p,"%c",&c);
+ printf("%c",c);
+ }
+ fclose(p);
+ return(0);
+}
diff --git a/fps b/fps
new file mode 100644
index 0000000..54ee2f3
Binary files /dev/null and b/fps differ
diff --git a/fputs b/fputs
new file mode 100644
index 0000000..3579f2b
Binary files /dev/null and b/fputs differ
diff --git a/fputs.c b/fputs.c
new file mode 100644
index 0000000..a1431d6
--- /dev/null
+++ b/fputs.c
@@ -0,0 +1,16 @@
+#include
+#include
+#include
+int main()
+{
+FILE *fp;
+
+fp = fopen("arquivos/fputs.txt", "w+"); // subscreve, passa por cima!!
+
+fputs("Esta é a programação c.", fp);
+fputs("Esta é uma linguagem de programação do sistema.", fp);
+
+fclose(fp);
+
+return(0);
+}
diff --git a/freadEx b/freadEx
new file mode 100644
index 0000000..2525edd
Binary files /dev/null and b/freadEx differ
diff --git a/freadEx.c b/freadEx.c
new file mode 100644
index 0000000..cd99ab9
--- /dev/null
+++ b/freadEx.c
@@ -0,0 +1,33 @@
+/* fread example: read an entire file */
+#include
+#include
+
+int main () {
+ FILE * pFile;
+ long lSize;
+ char * buffer;
+ size_t result;
+
+ pFile = fopen ( "myfile.bin" , "rb" );
+ if (pFile==NULL) {fputs ("File error",stderr); exit (1);}
+
+ // obtain file size:
+ fseek (pFile , 0 , SEEK_END);
+ lSize = ftell (pFile);
+ rewind (pFile);
+
+ // allocate memory to contain the whole file:
+ buffer = (char*) malloc (sizeof(char)*lSize);
+ if (buffer == NULL) {fputs ("Memory error",stderr); exit (2);}
+
+ // copy the file into the buffer:
+ result = fread (buffer,1,lSize,pFile);
+ if (result != lSize) {fputs ("Reading error",stderr); exit (3);}
+
+ /* the whole file is now loaded in the memory buffer. */
+
+ // terminate
+ fclose (pFile);
+ free (buffer);
+ return 0;
+}
diff --git a/freadTR b/freadTR
new file mode 100644
index 0000000..fbd5b3d
Binary files /dev/null and b/freadTR differ
diff --git a/freadTR.c b/freadTR.c
new file mode 100644
index 0000000..f7457c0
--- /dev/null
+++ b/freadTR.c
@@ -0,0 +1,19 @@
+#include
+#include
+
+int main()
+{
+// Declaramos um ponteiro(link para o endereço da memória) para o arquivo de nome: 'pf'
+FILE *pf;
+char conteudo[100];
+
+pf = fopen("arquivos/texto.txt", "rb"); /* Abre o arquivo novamente para leitura */
+
+fread(&conteudo, sizeof(char), 100,pf); /* Le em conteudo o valor da variável armazenada anteriormente pf */
+
+printf("\nO conteúdo do arquivo é':\n %s \n", conteudo);
+
+fclose(pf);
+
+return(0);
+}
diff --git a/fwriteTR b/fwriteTR
new file mode 100644
index 0000000..43e741b
Binary files /dev/null and b/fwriteTR differ
diff --git a/fwriteTR.c b/fwriteTR.c
new file mode 100644
index 0000000..5fdaad1
--- /dev/null
+++ b/fwriteTR.c
@@ -0,0 +1,26 @@
+#include
+#include
+int main()
+{
+FILE *pf;
+int NUM = 88;
+int pilido;
+if((pf = fopen("arquivos/arquivo.bin", "wb")) == NULL) /* Abre arquivo binário para escrita */
+{
+printf("Erro na abertura do arquivo");
+exit(1);
+}
+if(fwrite(&NUM, sizeof(int), 1,pf) != 1) /* Escreve a variável NUM | o operador sizeof, que retorna o tamanho em bytes da variável ou do tipo de dados. */
+printf("Erro na escrita do arquivo");
+fclose(pf); /* Fecha o arquivo */
+if((pf = fopen("arquivos/arquivo.bin", "rb")) == NULL) /* Abre o arquivo novamente para leitura */
+{
+printf("Erro na abertura do arquivo");
+exit(1);
+}
+if(fread(&pilido, sizeof(int), 1,pf) != 1) /* Le em pilido o valor da variável armazenada anteriormente */
+printf("Erro na leitura do arquivo");
+printf("\nO valor de NUM, lido do arquivo e': %d \n\n", pilido);
+fclose(pf);
+return(0);
+}
diff --git a/p2b.c b/p2b.c
new file mode 100644
index 0000000..70eae14
--- /dev/null
+++ b/p2b.c
@@ -0,0 +1 @@
+#include
diff --git a/relogio.c b/relogio.c
new file mode 100644
index 0000000..9a0b34c
--- /dev/null
+++ b/relogio.c
@@ -0,0 +1,9 @@
+#include
+clock_t times(struct tms *buf);
+struct tms {
+clock_t tms_utime; /* tempo de CPU gasto em código do processo */
+clock_t tms_stime; /* tempo de CPU gasto em código do sistema chamado pelo processo */
+clock_t tms_cutime; /* tempo de CPU dos filhos (código próprio) */
+clock_t tms_cstime; /* tempo de CPU dos filhos (cód. do sistema) *
+
+ticks_seg = sysconf(_SC_CLK_TCK);
diff --git a/relogio.c~ b/relogio.c~
new file mode 100644
index 0000000..42f52dc
--- /dev/null
+++ b/relogio.c~
@@ -0,0 +1,7 @@
+#include
+clock_t times(struct tms *buf);
+struct tms {
+clock_t tms_utime; /* tempo de CPU gasto em código do processo */
+clock_t tms_stime; /* tempo de CPU gasto em código do sistema chamado pelo processo */
+clock_t tms_cutime; /* tempo de CPU dos filhos (código próprio) */
+clock_t tms_cstime; /* tempo de CPU dos filhos (cód. do sistema) *
diff --git a/removeTR b/removeTR
new file mode 100644
index 0000000..e8131f1
Binary files /dev/null and b/removeTR differ
diff --git a/removeTR.c b/removeTR.c
new file mode 100644
index 0000000..94dae6e
--- /dev/null
+++ b/removeTR.c
@@ -0,0 +1,13 @@
+#include
+#include
+#include
+int main()
+{
+ /* 0(zero) é verdadeiro(true), e 1(um) é falso(false), em C usa-se números! */
+ if(remove("arquivos/Faded") == 0){
+ printf("Arquivo removido com sucesso!\n");
+ }else{
+ printf("Não removido, talvez não exista.\n");
+ }
+return(0);
+}
diff --git a/retorno b/retorno
new file mode 100644
index 0000000..5717222
Binary files /dev/null and b/retorno differ
diff --git a/retorno.c b/retorno.c
new file mode 100644
index 0000000..84c5551
--- /dev/null
+++ b/retorno.c
@@ -0,0 +1,11 @@
+/* 3a) Valor de retorno de um programa
+ * 23/02/2016
+ * Manuel Curral
+ */
+
+#include
+int main()
+{
+ puts("Olá World, estou na 1@ aula de SOPE :))))");
+ return 99.1;
+}
diff --git "a/revis\303\265es/ex1" "b/revis\303\265es/ex1"
new file mode 100644
index 0000000..430fe85
Binary files /dev/null and "b/revis\303\265es/ex1" differ
diff --git "a/revis\303\265es/ex1.c" "b/revis\303\265es/ex1.c"
new file mode 100644
index 0000000..b99253b
--- /dev/null
+++ "b/revis\303\265es/ex1.c"
@@ -0,0 +1,39 @@
+
+// Arrays & C‐Strings
+// ex_00.c
+// A program that reads the evolution of a person's weight
+// during some months of a year
+// JAS
+
+#include
+
+#define MAX_NAME_LENGTH 50 // avoid "magic numbers"
+#define NUM_MONTHS 12
+
+int main()
+{
+char name[MAX_NAME_LENGTH];
+int weight[NUM_MONTHS];
+int i;
+
+printf("Name ? ");
+scanf("%s", name); // try with "Lou Costello" :‐)
+
+for (i = 0; i < NUM_MONTHS; i++)
+{
+printf("weight[%d] ? ", i + 1);
+scanf("%d", &weight[i]);
+}
+
+for (i = 0; i < NUM_MONTHS; i++)
+{
+printf("weight[%d] = %d\n", i + 1, weight[i]);
+}
+
+// TO BE DONE ...??? complete the data processing
+
+return 0;
+}
+
+
+
diff --git a/sstream.cpp b/sstream.cpp
new file mode 100644
index 0000000..4bdfe15
--- /dev/null
+++ b/sstream.cpp
@@ -0,0 +1,18 @@
+#include // std::string
+#include // std::cout
+#include // std::stringstream, std::stringbuf
+#include
+using namespace std;
+int main () {
+ string nome = "Nuno Cr";
+ int idd = 20;
+ std::stringstream ss;
+ ss << nome << " , " << idd;
+ s string = ss.str();
+ /*
+ ss.str ("Example string");
+ std::string s = ss.str();
+ */
+ std::cout << s << '\n';
+ return 0;
+}
diff --git a/untitled b/untitled
new file mode 100644
index 0000000..7d43e29
--- /dev/null
+++ b/untitled
@@ -0,0 +1,35 @@
+//Pipes e FIFO's 3 Exemplo Pipe entre pai e filho:
+#include
+#include
+#include
+#include
+#define MAXLINE 128
+int main(void)
+{
+int
+n, fd[2];
+pid_t
+pid;
+char
+line[MAXLINE];
+pipe(fd);
+pid = fork( );
+if (pid > 0) {
+/* pai */
+close(fd[0]);
+/* fecha lado receptor do pipe */
+write(fd[1], "hello world
+\
+n", 12);
+close(fd[1]);
+}
+else {
+/* filho */
+close(fd[1]);
+/* fecha lado emissor do pipe */
+n = read(fd[0], line, MAXLINE);
+write(STDOUT_FILENO, line, n);
+close(fd[0]);
+}
+return 0;
+}