Calling random seed repeatedly is sort of overdoing it - or, in your case, even counterproductive. Do it once at program startup - if at all necessary as the compiler / interpreter may do it for you.
I know you are compiling a (C) program. Just as a hint, man awk explicitly says
Quote:
Srand(expr) is useful for repeating pseudo random sequences.
Although you are calling srand() with a sort of random parameter, the current system epoch time, the execution will be that fast epoch seconds will not change - that's why you lose the random effect.
hi all,
i have been trying to get a script working that can take in more than one option using getopt. But for some reason, even when i type in a covered option, it skips directly to my error message of "no match." Any ideas of what might be wrong?
set - 'getopt frd*: $*'
for i in $*
do... (6 Replies)
Hello ,
How to resolve below compilation error.activity_type is a member of structure and the output from databse will be stored in structure.Expected output wil l be either D or N or C .
sample struct format:
struct a{
char acAtivity_type;
}
code:
switch (a->activity_type)... (1 Reply)
I am just learning Tcl and there are few things about it that is perplexing me. I have a question about the switch statement.
Why are these two switch statements giving me different results?
$ cat test_switch.tcl
#!/usr/bin/tcl
set foo "abc"
switch abc a - b {puts "No. 1"} $foo {puts... (2 Replies)
Hey ,
I'm trying to perform the following command, however it cannot read the variable assigned earlier. I'm not sure why this happen. Please help thanks
while :
do
echo "what's ur name? (if none just press )"
read name
changeName = echo $name | sed "s/on/ey/"
echo $changeName #this... (8 Replies)
I started writing a script to save the files from a camera I got the other day, which mounts in /Volumes , and I got into it and started building this menu. The only problem is that the switch case is coming up as a syntax error at the parenthesis after a case. Here is the code:
while :
do
... (2 Replies)
Hello
i have a requirement where in a file i will get string. The length could be from 1 to 20. if the string is less than 6 characters ( ex: ABCD) . i need to append 'X' on right hand side to make it 6 characters (ex: ABCDXX). if suppose i get the same string from the file as ABCDXX then i... (5 Replies)
Hi
Am pretty new to C..
Am trying to pass the arguments from command line and use them in switch case statement..
i have tried the following
#include <stdlib.h>
main(int argc, char* argv)
{
int num=0;
if ( argc == 2 )
num = argv;
printf("%d is the num value",num);
switch ( num )
... (2 Replies)
I need to implement a looping logic.
If then
Go to /path1/file*
Get all the filename starting with file* and store it in a array
count file number and store it in variable like run
Ex: I found 3 file with starting file* so my run = 3
means my loop should run three time
May be... (1 Reply)
Discussion started by: Nsharma3006
1 Replies
LEARN ABOUT BSD
struct
STRUCT(1) General Commands Manual STRUCT(1)NAME
struct - structure Fortran programs
SYNOPSIS
struct [ option ] ... file
DESCRIPTION
Struct translates the Fortran program specified by file (standard input default) into a Ratfor program. Wherever possible, Ratfor control
constructs replace the original Fortran. Statement numbers appear only where still necessary. Cosmetic changes are made, including chang-
ing Hollerith strings into quoted strings and relational operators into symbols (.e.g. ".GT." into ">"). The output is appropriately
indented.
The following options may occur in any order.
-s Input is accepted in standard format, i.e. comments are specified by a c, C, or * in column 1, and continuation lines are specified
by a nonzero, nonblank character in column 6. Normally input is in the form accepted by f77(1)-i Do not turn computed goto statements into switches. (Ratfor does not turn switches back into computed goto statements.)
-a Turn sequences of else ifs into a non-Ratfor switch of the form
switch
{ case pred1: code
case pred2: code
case pred3: code
default: code
}
The case predicates are tested in order; the code appropriate to only one case is executed. This generalized form of switch state-
ment does not occur in Ratfor.
-b Generate goto's instead of multilevel break statements.
-n Generate goto's instead of multilevel next statements.
-tn Make the nonzero integer n the lowest valued label in the output program (default 10).
-cn Increment successive labels in the output program by the nonzero integer n (default 1).
-en If n is 0 (default), place code within a loop only if it can lead to an iteration of the loop. If n is nonzero, admit a small code
segments to a loop if otherwise the loop would have exits to several places including the segment, and the segment can be reached
only from the loop. `Small' is close to, but not equal to, the number of statements in the code segment. Values of n under 10 are
suggested.
FILES
/tmp/struct*
/usr/libexec/struct/*
SEE ALSO f77(1)BUGS
Struct knows Fortran 66 syntax, but not full Fortran 77.
If an input Fortran program contains identifiers which are reserved words in Ratfor, the structured version of the program will not be a
valid Ratfor program.
The labels generated cannot go above 32767.
If you get a goto without a target, try -e .
7th Edition October 22, 1996 STRUCT(1)