Read multiple files(.txt) c++
C++
#include <sstream>
#include <iostream>
#include <string>
using namespace std;
int main()
{
string filename;
ostringstream ss;
filename="data_";
for(int i;i<2;i++)
{
ss << filename << i;
FILE * f = fopen (ss.str(), "r");
if (NULL != f)
{
///.....some work
}
else
printf ("Could not open the file\n");
}
return 0;
}
Also in C++:
- Title
- c++ loop through int array
- Category
- C++
- Title
- count vector c++
- Category
- C++
- Title
- c++ std::copy to cout
- Category
- C++
- Title
- c++ loop through array
- Category
- C++
- Title
- set lower bound c++
- Category
- C++
- Title
- c++ program for addition of two numbers using functions
- Category
- C++
- Title
- elseif c++
- Category
- C++
- Title
- how to declare a vector in c++
- Category
- C++
- Title
- how to convert n space separated integers in c++
- Category
- C++
- Title
- nginx linux
- Category
- C++
- Title
- c++ how to skip the last element of vector
- Category
- C++
- Title
- how to execute c++ program in cmd
- Category
- C++
- Title
- digitalwrite C++
- Category
- C++
- Title
- cube mapping sdl
- Category
- C++
- Title
- sfml basic program
- Category
- C++
- Title
- int to float c++
- Category
- C++
- Title
- Shortest Distance in a Maze
- Category
- C++
- Title
- pairs in c++
- Category
- C++
- Title
- split 2d array into chunks in c++
- Category
- C++
- Title
- creare array con c++
- Category
- C++
- Title
- cout console
- Category
- C++
- Title
- heap sort
- Category
- C++
- Title
- add a timer c++
- Category
- C++
- Title
- inconsequential meaning
- Category
- C++
- Title
- if vector contains value c++
- Category
- C++
- Title
- error: ‘memset’ was not declared in this scope in cpp
- Category
- C++
- Title
- c++ show time elapsed
- Category
- C++
- Title
- correct sequence of compilation process in c++
- Category
- C++
- Title
- how to append one vector to another c++
- Category
- C++
- Title
- create a bitset of 1024 bits,
- Category
- C++
- Title
- how to print to the serial monitor arduino
- Category
- C++
- Title
- c++ typeid get type name
- Category
- C++
- Title
- Merge k sorted linked lists and return it as one sorted list.
- Category
- C++
- Title
- using namespace std in c++
- Category
- C++
- Title
- how to return a vector c++
- Category
- C++
- Title
- what is difference between ciel and floor
- Category
- C++
- Title
- array sort c++
- Category
- C++
- Title
- c++ switch case statement
- Category
- C++
- Title
- binary search stl in c++
- Category
- C++
- Title
- namespaces c++
- Category
- C++
- Title
- converting char to int in c++
- Category
- C++
- Title
- c++ evaluate expression
- Category
- C++
- Title
- COunt the number of continous subsequences such that the sum is between
- Category
- C++
- Title
- % operator in c++
- Category
- C++
- Title
- min coin change problem dp
- Category
- C++
- Title
- GetCurrentThreadId c
- Category
- C++
- Title
- c++ variable arguments
- Category
- C++
- Title
- c++ set console title
- Category
- C++
- Title
- c++ reading string
- Category
- C++
- Title
- c++ ros publisher
- Category
- C++
- Title
- Rectangle area hackerrank solution in c++
- Category
- C++
- Title
- caesar cipher program in c++
- Category
- C++
- Title
- c++ iterate over vector
- Category
- C++
- Title
- set in c++
- Category
- C++
- Title
- how to use winmain function
- Category
- C++
- Title
- C++ string format ctime
- Category
- C++
- Title
- initialization list c++
- Category
- C++
- Title
- tokenize string c++
- Category
- C++
- Title
- how to cout in c++
- Category
- C++
- Title
- namespace file linking c++
- Category
- C++
- Title
- private and public in namespace cpp
- Category
- C++
- Title
- how to print nth palindrome number in c++
- Category
- C++
- Title
- print matrix c++
- Category
- C++
- Title
- c++ compiler for sublime text
- Category
- C++
- Title
- jump to case label c++
- Category
- C++
- Title
- regexp_like oracle c++
- Category
- C++
- Title
- initialize int c++
- Category
- C++
- Title
- variadic templates
- Category
- C++
- Title
- unsorted array to bst
- Category
- C++
- Title
- std::substring
- Category
- C++
- Title
- c++ try
- Category
- C++
- Title
- find upper bound c++ vector
- Category
- C++
- Title
- minimum swaps to sort an array
- Category
- C++
- Title
- translate
- Category
- C++
- Title
- find_if c++ example
- Category
- C++
- Title
- repeating character in c++
- Category
- C++
- Title
- char **
- Category
- C++
- Title
- modulo c++
- Category
- C++
- Title
- how to iterate trough a vector in c++
- Category
- C++
- Title
- map insert c++
- Category
- C++
- Title
- properties of a set c++
- Category
- C++
- Title
- how to concatinate two strings in c++
- Category
- C++
- Title
- widechartomultibyte
- Category
- C++
- Title
- visual studio 2019 read and write text file c++
- Category
- C++
- Title
- how to import getline in c++
- Category
- C++
- Title
- can you use rand to read in from an external file inc++
- Category
- C++
- Title
- insertion c++
- Category
- C++
- Title
- is TLE means my code is correct but taking more time to computr
- Category
- C++
- Title
- solve linear equations geeksforgeeks
- Category
- C++
- Title
- lambda c++
- Category
- C++
- Title
- c++ pi
- Category
- C++
- Title
- first prime numbers less than
- Category
- C++
- Title
- range based for loop c++
- Category
- C++
- Title
- statement that causes a function to end in c++
- Category
- C++
- Title
- cpp loop through object
- Category
- C++
- Title
- how to initialize a vector in c++
- Category
- C++
- Title
- use of strstr in c++
- Category
- C++
- Title
- gfg right view of tree
- Category
- C++
- Title
- Newton's sqrt in c++
- Category
- C++
- Title
- convert integer to string c++
- Category
- C++