Jump to content
Fórum Script Brasil
  • 0

Leio arquivo mas não consigo comparar com IF



Pessoal bom dia. Estou reaprendendo a programar, depois de um acidente que me fez perder muita coisa, inclusive memoria.

Fiz um programa que pega um valor que ta num arquivo e armazena numa variavel, mas não consigo comparar pra ver se é igual a alguma palavra que tenho. podem me ajudar?

#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
using namespace std;

int main()
  FILE *arq;
  char Linha[20]={ };
  char ch;
  char *result;
  int i;
  system("powershell \"Get-CimInstance -ClassName Win32_ComputerSystem | foreach { $_.Manufacturer }\" > arqsnipe.txt");
  arq = fopen("arqsnipe.txt", "rt");
  result = fgets(Linha, 20, arq);
  for (i=0;i<=19;i++){
    printf("%c - %i\n",Linha, i);

  if (Linha == "Hewlett-Packard"){
    printf("\nOpcao 1\n");
    printf("\nOpcao 2\n");


Edited by medicisolucoes
Acrescimo de Resultado
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.

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.


  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...