Click here to Skip to main content
15,901,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Stop the looping...(urgent) Pin
makaveli_074-May-06 18:42
makaveli_074-May-06 18:42 
GeneralRe: Stop the looping...(urgent) Pin
Stephen Hewitt4-May-06 18:13
Stephen Hewitt4-May-06 18:13 
GeneralRe: Stop the looping...(urgent) Pin
Aqueel4-May-06 18:16
Aqueel4-May-06 18:16 
GeneralRe: Stop the looping...(urgent) Pin
makaveli_074-May-06 18:44
makaveli_074-May-06 18:44 
GeneralRe: Stop the looping...(urgent) Pin
Aqueel4-May-06 18:50
Aqueel4-May-06 18:50 
GeneralRe: Stop the looping...(urgent) Pin
makaveli_074-May-06 19:02
makaveli_074-May-06 19:02 
GeneralRe: Stop the looping...(urgent) Pin
Cedric Moonen4-May-06 20:31
Cedric Moonen4-May-06 20:31 
GeneralRe: Stop the looping...(urgent) Pin
makaveli_074-May-06 18:48
makaveli_074-May-06 18:48 
now everythin is okie but...onli one line of digit output in the file..i need all the possible randomized shuffling..

<code>#include <ctime>
#include <iostream>
#include <string>
#include <algorithm>
#include <fstream>
using namespace std;

time_t tmStart, tmEnd;



void DoStuff()
{
tmStart = time(0);

ifstream fin("data.txt",ios::in);
ofstream File("MyFile.txt",ios::out);



char str[14];
// fin.getline(str,sizeof(str),'\n');
// string line(str);

//cout << str<<endl;


int i=0;
// while(fin.eof() == NULL )
while(true)
{
if(fin.getline(str,sizeof(str),'\n'))
{
string line(str);
random_shuffle(line.begin(), line.end());
File << "Randomised: " << line << endl;
File << " : " << line << endl;
File << " : " << line << endl;
File << " : " << line << endl;
File << " "<< endl;

// File << "Single Row: " << s << " " << s << " " << s <<" " << s << endl;
File << " "<< endl;

++i;
//continue;


tmEnd = time(0);
cout << tmEnd-tmStart << " seconds " << endl;
}else break;




}

File.close ();
fin.close ();

}

int main(int argc, char* argv[])
{
DoStuff();

return 0;

}


</code>


GeneralRe: Stop the looping...(urgent) Pin
Stephen Hewitt4-May-06 18:55
Stephen Hewitt4-May-06 18:55 
GeneralRe: Stop the looping...(urgent) Pin
Cedric Moonen4-May-06 20:34
Cedric Moonen4-May-06 20:34 
QuestionMicrosoft is looking for potential C++ MVPs Pin
Chris Maunder4-May-06 15:36
cofounderChris Maunder4-May-06 15:36 
AnswerRe: Microsoft is looking for potential C++ MVPs Pin
led mike4-May-06 16:44
led mike4-May-06 16:44 
AnswerRe: Microsoft is looking for potential C++ MVPs Pin
Trollslayer4-May-06 21:50
mentorTrollslayer4-May-06 21:50 
GeneralRe: Microsoft is looking for potential C++ MVPs Pin
Maxwell Chen4-May-06 21:58
Maxwell Chen4-May-06 21:58 
GeneralRe: Microsoft is looking for potential C++ MVPs Pin
Chris Maunder5-May-06 1:23
cofounderChris Maunder5-May-06 1:23 
GeneralRe: Microsoft is looking for potential C++ MVPs Pin
Blake Miller5-May-06 6:55
Blake Miller5-May-06 6:55 
Questionvolume of solids of revolution Pin
john over4-May-06 14:11
john over4-May-06 14:11 
AnswerRe: volume of solids of revolution Pin
Stephen Hewitt4-May-06 14:37
Stephen Hewitt4-May-06 14:37 
Questionxcopy custom build step Pin
Phil Francis4-May-06 13:46
Phil Francis4-May-06 13:46 
GeneralRe: xcopy custom build step Pin
George L. Jackson4-May-06 17:23
George L. Jackson4-May-06 17:23 
GeneralRe: xcopy custom build step Pin
Phil Francis4-May-06 20:44
Phil Francis4-May-06 20:44 
GeneralRe: xcopy custom build step Pin
George L. Jackson5-May-06 5:54
George L. Jackson5-May-06 5:54 
AnswerRe: WIN32 Pin
Gerald Schwab4-May-06 11:27
Gerald Schwab4-May-06 11:27 
QuestionHow to get char[] from CEdit control Pin
masnu4-May-06 10:51
masnu4-May-06 10:51 
AnswerRe: How to get char[] from CEdit control Pin
led mike4-May-06 11:23
led mike4-May-06 11:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.