Jump to content
Fórum Script Brasil
  • 0

Entrada Formatada Usando O Scanset


Guest Jean Carlos
 Share

Question

Guest Jean Carlos

Olá sou novo por aki.

to tendo um problema com Scanset

assim, estou fazendo uma leitura de um arquivo :

Ele é mais o menos assim:

P3

# Created by IrfanView

1600 1200

255

ae eu uso

char tipo[];
    char comentario[];
    int comprimento;
    int largura;
    char tam_pix[];


    fscanf(fp, "%[^\n]\n",tipo);
    fscanf(fp, "%[^\n]",comentario);
    fscanf(fp,"%d %d\n",&comprimento,&largura);
    fscanf(fp, "%[^\n]\n",tam_pix);


    printf("%s\n",tipo);
    printf("%s\n",comentario);
    printf("%d x %d\n",comprimento, largura);
    printf("%s",tam_pix);

ae aparece:

@♠

@♠

1600 x 1200

255

alguém sabe porque? porque segundo o livro ta certo

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Forum Statistics

    • Total Topics
      150.2k
    • Total Posts
      647.5k
×
×
  • Create New...