Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Generating 128 files with different names in one program.
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
UWO




PostPosted: Fri Oct 28, 2005 8:35 am   Post subject: Generating 128 files with different names in one program.

Hi all,

I need to generate 128 different files. I have a C program that i have designed that generates one file at a time. I have one option that i compile my program 128 times and while compiling i give different names or i could write a small C program or a script that would deal with the situation. The problem i get when i want the file to have 128 different names. The file saves strings only while saving the file, it does not read integers as i tried to save the file with in an integer loop. What step should i take in order to save the file with different names.

Regaards,

UWO.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Fri Oct 28, 2005 8:56 am   Post subject: (No subject)

you could use the ASCII equivelent of the integer. Just make sure you stay in the alphabetic boundary Wink
Mazer




PostPosted: Fri Oct 28, 2005 3:54 pm   Post subject: (No subject)

Why not convert an integer to a string?
MysticVegeta




PostPosted: Mon Oct 31, 2005 6:35 pm   Post subject: (No subject)

what is the command to do that?
wtd




PostPosted: Mon Oct 31, 2005 7:31 pm   Post subject: (No subject)

c++:
#include <sstream>
#include <iostream>
#include <string>

int main()
{
   int number(42);
   std::string output;
   std::stringstream ss;

   ss << number;

   ss >> output;

   std::cout << output << std::endl;
}
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: