voltar

Voltar



C++

Esse espaço dispõe de programas que fiz, para aprender a programar e alguns links úteis para aprender a programar em C++ .

Seção onde ?
Meus Programas
Meus Programas
http://www.cplusplus.com/
CPlusPlus
Links úteis (Mais sobre STL )
Links úteis (Mais sobre STL )
Baixe o Livro: The ANSI C Programming Language 2nd ed. by Brian W. Kernighan and Dennis M. Ritchie.pdf (Ritchie o criador da lkinguagem C)
Baixe o Livro: The ANSI C Programming Language 2nd ed. by Brian W. Kernighan and Dennis M. Ritchie.pdf (Ritchie o criador da lkinguagem C)
Programming in C UNIX System Calls and Subroutines using C. $\copyright$ A. D. Marshall 1994-2005 Substantially Updated March 1999
Programming in C UNIX System Calls and Subroutines using C. $\copyright$ A. D. Marshall 1994-2005 Substantially Updated March 1999

Tutorial de C++

under-linux.org:

http://under-linux.org/wiki/index.php/Tutoriais/Programacao/tutorialc




Linguagem de Programação C

Nesta seção, dispõe apostilas, tutoriais e meus programas que eu fiz para aprender a programar em C







Materiais sobre a Biblioteca Grafica Multiplataforma GTK - Graphic Tool Kit - Ferramenta de Desenvolvimento Grafico, acesse o site abaixo:

http://www.oocities.org/br/danilomatias17/Programacao/CPlusPlus/index/GTK/gtk.html








Algumas apostilas online, inclusive com protótipos e descrições de funções para consulta rápida

Acesse - CURSO DE LINGUAGEM C:
http://www.inf.lasalle.tche.br/~barreto/cursoC/
Funções de string em C
Contém inclusive a

char *strtok(char *s, const char *delim);

, que não tem nos demais links:
http://ipfix.wordpress.com/2007/05/07/funcoes-de-string-em-c/
Curso de Linguagem C
MATRIZES E STRINGS:
http://www.inf.lasalle.tche.br/~barreto/cursoC/

CURSO DE LINGUAGEM C

Strings


http://www.inf.lasalle.tche.br/~barreto/cursoC/c520.html

Programar em C/Estudo

De Wikibooks

Tabela de conteúdo


http://pt.wikibooks.org/wiki/Programar_em_C/Estudo
MAC0122 Princípios de Desenvolvimento de Algoritmos
Cadeias de caracteres (= strings)
http://www.ime.usp.br/~pf/mac0122-2002/aulas/strings.html
Capítulo 15 - Funções da Biblioteca Standard
http://www.carlosfelgueiras.hpg.com.br/Cursos/LinguagemC/Cap_15.html

6. strings
http://www.oocities.org/br/sdiasneto/c_int/strings.htm
Linguagem C - intermediário
http://www.oocities.org/br/sdiasneto/c_int/index.htm
Samuel Dias Neto sdiasneto@yahoo.com.br
C - Básico
C - Tipos de dados
C - Intermediário
C - Manipulando argumentos da linha de comando
C - stdarg (lista de argumentos variável)
C - Usando o utilitário make
C - Processando opções da linha de comando
C - Tratamento de erro
C - Entrada de strings
Algoritmos
HTML básico
Formulários HTML
Editor de textos vi - Tutorial
Tutorial Vim 6.0.270
Shell
Expressões regulares
Usando o comando ftp
Usando o gerenciador de downloads wget
Tutorial PHP
Tutorial MySQL
Acessando banco de dados MySQL com PHP
Aprendendo Python
Manual de Privacidade GNU (como usar o GnuPG)
CDTC - Gerenciadores de boot
CDTC - Bind
CDTC - Apache
CDTC - Iptables
GIMP - Tipos de arquivos de imagem
Tutoriais sobre Blender (inglês)

http://www.oocities.org/br/sdiasneto/
CURSO DE LINGUAGEM C
http://www.inf.lasalle.tche.br/~barreto/cursoC/

APRENDENDO A LINGUAGEM C
http://www.global.estgp.pt/engenharia/Alunos/eSebentas/Tutoriais/c.htm
Sequências de caracteres em C ( strings)
http://www.ncc.up.pt/~nam/aulas/9900/pi/slides/slipi9914/slipi9914.html
Pequena introducao do C (under-linux.org)

http://under-linux.org/wiki/index.php/Tutoriais/Programacao/basico-c
Controle de Fluxo em C
http://under-linux.org/wiki/index.php/Tutoriais/Programacao/controle-fluxo-c

Leitura e Gravação de Arquivos em C (Nao fala como fazer no linux ...)
http://under-linux.org/wiki/index.php/Tutoriais/Programacao/arquivos-c





Código onde usei leitura de arquivo em linux, o código não faz o que se propõe mas pelo menos a leitura de arquivo faz corretamente, quanto a escrita não me preocupei ainda, mas a hora que me preocupar eu coloco aqui.
Não me preocupei com a escrita devido a poder usar o redirecionamento de saída padrão (>) para o arquivo que quero



#include <stdlib.h>

#include <stdio.h>

#include <string.h>

#define LEITURA 0

#define ESCRITA 1

#define LEITURAESCRITA 2

/*===================================================================*/

/*===================================================================*/

void mostraRespricoes();

int open1(char *file, int oflag );

void prog();

char *gettextoarq(int fd, char *buf, int buf_size, char *texto);

char *gettextoarq1Somenteleitura( char *arq, char *texto);

char ***getLinhasSomenteleitura(char *arq, int *j, char ***texto4);

void mostraLinhas(char **linhas, int *j);

char *getLinhaISomenteleitura(char *arq, int *j, char *linha, int I);

/*===================================================================*/

/*===================================================================*/

void mostraLinhas(char **linhas, int *j)

{

int i, k;

k = *j;

printf("%s --->>>>>> linhas[0]", linhas[0]);

printf("%s --->>>>>> linhas[1]", linhas[1]);

for(i=0;(i < k )||(linhas[i]!=NULL); i++)

{

printf("%s", linhas[i]);

}

printf(" \n\n ");

}

/*===================================================================*/

void mostraRespricoes()

{

printf(" 1 - O arquivo pdf3.sh tem que estar no mesmo diretorio que esse programa\n");

printf(" 2 - O arquivo arqpdf.txt tem que estar no mesmo diretorio \n ");

printf(" 3 - Os arquivos a serem convertidos devem estar no mesmo diretorio \n");

printf(" \n\n ");

}

/*===================================================================*/

/*===================================================================*/

/*===================================================================*/

/* fazer uma função que retorne somente a string da linha,

* deve-se passar a linha e um ponteiro onde string estara*/

char *getLinhaISomenteleitura(char *arq, int *j, char *linha, int I)

{

int i;

char texto[500][500], text[10000], *t1, *t2, charater[500];

printf("\n Agora entrarei na funcao t1=gettextoarq1Somenteleitura(arq, t1);\n");

t1=gettextoarq1Somenteleitura(arq, t1);

//printf(" t1 = %s", t1);

sprintf(text, "%s", t1);

/* agora com a string t1 tendo uma copia em "text"

* da pra ficar mais aliviado, pois nao perderemos o

* conteudo do arquivo, os nomes dos documentos*/

t2=strtok(text, "\n");

sprintf(texto[0], "%s", t2);

*j=i;

if(I==0)

{

if(*linha==NULL)

{/* se estiver passando somente um

* ponteiro sem nada , NULL*/

linha=texto[0];

}

sprintf(linha, "%s", texto[0]);

return linha;

}

//printf("*j= %i \t", *j);

for(i=1;(i<500)||(t2!=NULL); i++)

{

t2=strtok('\0', "\n");

sprintf(charater, "%s", t2);

strcpy(texto[i], charater);

*j=i;

// printf("*j= %i \t", *j);

if(t2==NULL || strlen(charater)<3)

{

*j=i;

printf(" \n A linha pedida para a funcao e maior que a quanidade de linhas no arquivo! \n Retornarei a ultima linha do arquivo\n ");

if(*linha==NULL)

{/* se estiver passando somente um

* ponteiro sem nada , NULL*/

linha=texto[i-1];

/*linha = *//*strcpy(linha, texto[i-1]);*/

return linha;

}

sprintf(linha, "%s", texto[i-1]);

return linha;

}

if(i==I)

{

if(*linha==NULL)

{/* se estiver passando somente um

* ponteiro sem nada , NULL*/

linha=texto[i];

return linha;

}

sprintf(linha, "%s", texto[i]);

return linha;

}

}

return NULL;

}


/*===================================================================*/


char ***getLinhasSomenteleitura(char *arq, int *j, char ***texto4)

{

int i;

char texto[500][500], text[10000], *t1, *t2, charater[500];

t1=gettextoarq1Somenteleitura(arq, t1);

sprintf(text, "%s", t1);

/* agora com a string t1 tendo uma copia em "text"

* da pra ficar mais aliviado, pois nao perderemos o

* conteudo do arquivo, os nomes dos documentos*/

t2=strtok(text, "\n");

sprintf(texto[0], "%s", t2);

*j=i;

//printf("*j= %i \t", *j);

for(i=1;(i<500)||(t2!=NULL); i++)

{

t2=strtok('\0', "\n");

sprintf(charater, "%s", t2);

strcpy(texto[i], charater);

*j=i;

// printf("*j= %i \t", *j);

if(t2==NULL || strlen(charater)<3)

{

*j=i;

*texto4=&texto[0][0];

return texto4;

}

}

*texto4=&texto[0][0];

return texto4;

}

/*===================================================================*/

char *gettextoarq1Somenteleitura( char *arq, char *texto)

{

int fd, buf_size;

char buf[500], buf2[10000], *buf3;

buf_size=499;

fd=open1(arq, LEITURA);

//printf("\n Agora entrarei na funcao buf3=gettextoarq(fd, buf, buf_size,buf2);\n");

buf3=gettextoarq(fd, buf, buf_size,buf2);

if(*texto==NULL)

{/* se estiver passando somente um

* ponteiro sem nada , NULL*/

texto=buf3;

}

sprintf(texto, "%s", buf3);

//printf("\n Agora entrarei na funcao close(fd);\n");

close(fd);

//printf("\n O conteudo do arquivo %s e :\n %s \n", arq, buf3);

return buf3;

}

/*===================================================================*/

char *gettextoarq(int fd, char *buf, int buf_size, char *texto)

{

for(;;)

{

if(read(fd, buf, buf_size)==0)

{

sprintf(texto, " %s \n", buf);

return texto;

}

sprintf(texto, " %s \n", buf);

}

}

/*===================================================================*/

int open1(char *file, int oflag )

{

int fd;

if((fd=open(file, oflag))==-1)

{

printf("\n Nao e possivel abrir o arquivo %s \n", file);

return fd;

}

return fd;

}

/*===================================================================*/

void prog()

{

char cmd[400], arq[200], texto[600], **t1, ***t6, *t7;

int i;

t7=NULL;

sprintf(arq, "%s", "arqpdf.txt");

//sprintf(stdout ,"%s", "imprimindo na tela, stdout com sprintf");

printf("\n\n\n\n Programa que concatenara todos os arquivos .pdf em um \n\n\n ");

printf(" Para esse programa funcionar direito e Necessario que: \n ");

mostraRespricoes();

sprintf(cmd, "for x in *.pdf; do echo %s ", "\"$x\"; done > arqpdf.txt");

system(cmd);

printf(" \n ");

/* printf("\n Agora entrarei na funcao t6 = getLinhasSomenteleitura(arq, &i, &t1);\n");

t6 = getLinhasSomenteleitura(arq, &i, &t1);

/**/printf("\n Agora entrarei na funcao getLinhaISomenteleitura(arq, &i, t7, 3);\n");

t7=getLinhaISomenteleitura(arq, &i, t7, 3);

/**/printf("\n t1[0] %s\n t7 ([%i])= %s \n", t1[0], 3, t7);

printf("\n t1[%i] %s\n", 1, t1[1]);

printf("\n t1[%i] %s\n", 2, t1[2]);

printf("\n t1[%i] %s\n", 3, t1[3]);

//mostraLinhas(t1, &i);

printf(" \n\n\n\n\n\n");

}

/*===================================================================*/

int main()

{

prog();

return ;

}

/*===================================================================*/































diversos programas em C.
Ótimo para iniciantes

C Completo e Total em pdf (Fonte: www.esnips.com)
Excelente livro. Recomendo

Estruturas de Dados Usando C Tanenbaum em pdf (Fonte: www.esnips.com)
Excelente livro de Estruturas de Dados. Recomendo

Apostila da UFMG
Bom para iniciantes

Usando Expressões Regulares na Linguagem C

Usando o utilitário make (Fonte: sdiasneto/c/)
http://www.oocities.org/br/sdiasneto/c/make.html

Processando opções da linha de comando (Fonte: sdiasneto/c/)
http://www.oocities.org/br/sdiasneto/c/opcoes_linha_cmdo.html

Livro: The ANSI C Programming Language 2nd ed. by Brian W. Kernighan and Dennis M. Ritchie (Fonte: Esnips)
Baixe esse livro recomendado para iniciantes em C (o autor é o criador da linguagem C)

Tutorial da linguagem C (Linux)

Tutorial de Sockets - Parte-I

Tutorial de Sockets - Parte-II

Tutorial de Sockets - Parte-III

Tutorial de Sockets - Parte-IV

Tutorial de Sockets - Parte-V

Tutorial de Sockets - Parte-VI

Tutorial de Sockets - Parte-VII

Sockets para Linux

Programação em Sockets em C++ sob Linux

Programando Socket em C++ sem segredo

Exemplo de Sockets em C no Windows e no Linux

Socket em C

Programming in C UNIX System Calls and Subroutines using C




Kernel Linux:

http://br.kernelnewbies.org/
"O br.kernelnewbies.org é uma fonte de referência em português para programadores interessados em conhecer, aprender, ensinar e contribuir para desenvolvimento do kernel Linux. Este projeto é o espelho brasileiro do www.kernelnewbies.org."
- http://br.kernelnewbies.org


Dennis M. Ritchie:


http://cm.bell-labs.com/cm/cs/who/dmr/bigbio1st.html
"Demis Ritchie created language C program. The best language program in the world

Read more about Demis Ritchie at: http://cm.bell-labs.com/cm/cs/who/dmr/index.html included the phone number





E-BOOK: Linux Device Drivers, Third Edition
"This is the web site for the Third Edition of Linux Device Drivers, by Jonathan Corbet, Alessandro Rubini, and Greg Kroah-Hartman. For the moment, only the finished PDF files are available; we do intend to make an HTML version and the DocBook source available as well." - Linux Device Drivers, Third Edition

Or Download here ((23 Files .pdf).zip - 11,6 MB - Esnips)

Or Download at Official Page



Voltar para o Topo