Duda eficiencia implementativa
Cual de estas dos formas de trabajar con archivos es mas eficiente. Esta:
while((index_end = titles.find(0x20,index_start))!= string::npos)
{
sep_titles.push_back(titles.substr(index_start,index_end-index_start));
index_end++;
index_start=index_end;
}
o esta:
char str[255];
char * pch;
fgets(str,255,prueba);
pch = strtok (str," ");
while (pch != NULL)
{
printf ("%sn",pch);
pch = strtok (NULL, " ");
}
otra duda.
diferencias entre:
#define t_sep_titles std::vector<string>
y
typedef std::vector<string> t_sep_titles;
De antemano muchas gracias por sus respuestas
while((index_end = titles.find(0x20,index_start))!= string::npos)
{
sep_titles.push_back(titles.substr(index_start,index_end-index_start));
index_end++;
index_start=index_end;
}
o esta:
char str[255];
char * pch;
fgets(str,255,prueba);
pch = strtok (str," ");
while (pch != NULL)
{
printf ("%sn",pch);
pch = strtok (NULL, " ");
}
otra duda.
diferencias entre:
#define t_sep_titles std::vector<string>
y
typedef std::vector<string> t_sep_titles;
De antemano muchas gracias por sus respuestas
