| | |
Where can I find examples of scripts?
![]() |
•
•
Join Date: Jul 2005
Posts: 24
Reputation:
Solved Threads: 0
I have a random number generator which outputs a file that my program uses. I want to be able to write something so that I don't have to manually execute the random number generator and then manually move the file to where the program need it. Pretty much have the random number generator and the program to run without having me execute them each time. I am only familliar with c++, I do not know any pearl. I hope this is more clear.
-Al
-Al
•
•
Join Date: Nov 2004
Posts: 108
Reputation:
Solved Threads: 3
Here:
C++ Syntax (Toggle Plain Text)
while(1) { //your code here }
Join me on IRC:
Server: irc.daniweb.com
Channel: #C++
Chat Via:
http://daniweb.com/chat/minichat.php
or
Your favorite IRC client.
Server: irc.daniweb.com
Channel: #C++
Chat Via:
http://daniweb.com/chat/minichat.php
or
Your favorite IRC client.
•
•
Join Date: Jul 2005
Posts: 24
Reputation:
Solved Threads: 0
What will that do? The program I am running is a Fortran program. What is does is run a simulation. I have a code that outputs a file for the fortran program, and when it has that program I run the simulation. The simulation roughly an hour to run, what I am trying to do is have the program continue to run for about 2 months without me having to execute the program each time. I pretty much want something where I can start it one day, and check on it a week later or something to that extent.
•
•
•
•
Originally Posted by prog-bman
Here:
C++ Syntax (Toggle Plain Text)
while(1) { //your code here }
•
•
Join Date: Jul 2005
Posts: 24
Reputation:
Solved Threads: 0
I know essentially no nothing about writing scripts, I was led to believe I could write a script in c++ (the only language I know). All I need to do is execute the fortran program, nothing more than that. From everyone's responses I take it you can't write a script in c++, I'm just trying to figure out what I need to do because I am in the dark. Thanks, sorry for frustrating anyone out there.
-Al
-Al
•
•
Join Date: Mar 2005
Posts: 36
Reputation:
Solved Threads: 1
C++ Syntax (Toggle Plain Text)
#include <iostream> #include <fstream> using namespace std; int main() { int num = rand(); ofstream cFile; cFile.open("RanNum.txt"); loop: cFile << num << endl; goto loop; }
A very simple way of doing it which can eventualy overload your computer (I think). However, I'm confused how you want to move the file.
![]() |
Other Threads in the C++ Forum
- Previous Thread: Program alone doesn't help.
- Next Thread: I am very new to C++ and don't know what i am doing wrong
| Thread Tools | Search this Thread |
api array based binary bitmap c++ c/c++ char class classes classified code coding compatible compile console conversion count date delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file filewrite forms fstream function functions game givemetehcodez graph gui homeworkhelp homeworkhelper homeworksolutions iamthwee icon if...else ifstream input int integer java lib linkedlist linker loop looping loops map math matrix memory multiple news node object output play pointer problem program programming project python random read recursion reference rpg string strings struct symbol temperature template test text text-file toolkit tree url values variable vector video win32 windows winsock wordfrequency wxwidgets






