Juin Posted December 31, 2009 at 08:55 PM Report Share #303504 Posted December 31, 2009 at 08:55 PM Boas, podem ajudar-me aqui... for(i=0; i<aut; i++) printf("Autores: %s\n", info[i].autores[NCHAR]); e aqui.... for(i=0; i<4 ;i++) fprintf(f,"%s;\n", propostas[i].autores); Nos dois da o mesmo erro... Link to comment Share on other sites More sharing options...
Localhost Posted December 31, 2009 at 08:57 PM Report Share #303506 Posted December 31, 2009 at 08:57 PM Não utilizes indice no primeiro, já te tinha dito no outro post here since 2009 Link to comment Share on other sites More sharing options...
Juin Posted December 31, 2009 at 09:00 PM Author Report Share #303507 Posted December 31, 2009 at 09:00 PM mas sao 4 autores... uso o do... while? Link to comment Share on other sites More sharing options...
Localhost Posted December 31, 2009 at 09:10 PM Report Share #303510 Posted December 31, 2009 at 09:10 PM Deixa-me ver se percebi, tu tens um array de autores? Esse NCHAR é o total de autores correcto? Assim não precisavas de ter o i para nada naquele loop, faz o seguinte: for(i=0; i<aut; i++){ printf("Autor: %s\n", info.autores[i]); } Se o código todo é complicado mas acho que é isso. Edit: Tu no C não podes printar um array de uma só vez. here since 2009 Link to comment Share on other sites More sharing options...
Juin Posted December 31, 2009 at 09:15 PM Author Report Share #303511 Posted December 31, 2009 at 09:15 PM nao NCHAR é uma variáel definida para o numero maximo de caracteres a utilizar aut é o numero maximo de autores Link to comment Share on other sites More sharing options...
Juin Posted December 31, 2009 at 09:18 PM Author Report Share #303512 Posted December 31, 2009 at 09:18 PM mas ja da certo tinha que utilizar propostas.autores[ i ][NCHAR] Link to comment Share on other sites More sharing options...
Localhost Posted December 31, 2009 at 09:19 PM Report Share #303513 Posted December 31, 2009 at 09:19 PM Isso é um bocado esquisito, porque quando tu fazes printf de um vector não podes imprimi-lo de uma só vez mas ok. here since 2009 Link to comment Share on other sites More sharing options...
Juin Posted December 31, 2009 at 10:04 PM Author Report Share #303522 Posted December 31, 2009 at 10:04 PM q estupido agora ta me a dar isto C:/Documents and Settings/João Horta/Os meus documentos/NetBeansProjects/Project/funcoes.c:28: multiple definition of `AdicionarPropostas' build/Debug/MinGW-Windows/funcoes.o:C:/Documents and Settings/João Horta/Os meus documentos/NetBeansProjects/Project/funcoes.c:28: first defined here so por eu ter isso... #include "funcoes.c" AdicionarPropostas(INDEX); em funcoes.c tenho esta funcao adicionar e quando a inclui no principal da me erros de declarar estas funcoes ... Link to comment Share on other sites More sharing options...
TheDark Posted January 1, 2010 at 12:11 AM Report Share #303529 Posted January 1, 2010 at 12:11 AM Isso é um bocado esquisito, porque quando tu fazes printf de um vector não podes imprimi-lo de uma só vez mas ok. Pode, se for um array de caracteres. #include "funcoes.c" AdicionarPropostas(INDEX); em funcoes.c tenho esta funcao adicionar e quando a inclui no principal da me erros de declarar estas funcoes ... Se estás a incluir o ficheiro funcoes.h, e lá defines a função AdicionarPropostas, não precisas de a declarar no ficheiro onde estás a fazer o #include. Desaparecido. Link to comment Share on other sites More sharing options...
Localhost Posted January 1, 2010 at 12:25 AM Report Share #303530 Posted January 1, 2010 at 12:25 AM Pode, se for um array de caracteres. TheDark, não era isso que eu estava a dizer! O que eu estava a falar era do facto de ele colocar o indice ao imprimir o o que queria imprimir! here since 2009 Link to comment Share on other sites More sharing options...
TheDark Posted January 1, 2010 at 04:01 AM Report Share #303534 Posted January 1, 2010 at 04:01 AM Mas foi o que disseste: Edit: Tu no C não podes printar um array de uma só vez. Desaparecido. Link to comment Share on other sites More sharing options...
Localhost Posted January 1, 2010 at 04:13 PM Report Share #303558 Posted January 1, 2010 at 04:13 PM My bad, expressei-me mal ? here since 2009 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now