Hello, as the question says, what I want to know is whether it is possible to load a list of words in an arrangement the way I am doing it. If someone can help me please here is a fragment of the code:
#include<iostream>
#include<synchapi.h>
#include<string.h>
#include<stdio.h>
using namespace std;
int main()
{
FILE *cargar_verbos;
int c_v=0;// este lo utilizo como contador
string c__v; // este lo utilizo para cargar la palabra
cargar_verbos=fopen("verbos_ar.txt","r");
// el siguiente while lo utilizo para saber cuantas palabras hay en el
//archivo pues en este punto no tenemos ni idea.
while(!feof(cargar_verbos))
{
fscanf(cargar_verbos,"%s",&c__v);
c_v++; // por eso uso este contador
}
string verbos_ar[c_v]; //declaro el arreglo tipo string y utilizo el
//contador para declarar la cantidad
c_v=0; // paso el contador nuevamente a cero
while(!feof(cargar_verbos)) // aqui es donde tengo el problema
{
fscanf(cargar_verbos,"%s",&verbos_ar[c_v]); // esta es mi duda
c_v++;
}
fclose(cargar_verbos);
}
As you can see in the part that loads the word in the array I put the counter as an indicative and as I should store the word without problems but whenever I run the program and get to that part I get an error. If someone can help me, I would really appreciate it.