User Profile

Collapse

Profile Sidebar

Collapse
jerinjoy
jerinjoy
Last Activity: Jun 14 '07, 03:50 AM
Joined: Sep 20 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Thanks Miller!

    #>perl scratch.pl -x="-number 1 -string abc"
    #userprog = '-number 1 -string abc'

    The '=' is fine!

    Jerin
    See more | Go to post

    Leave a comment:


  • Use GetOpt option to read in string containing "-S -DWT"

    Hi,

    I'm not very familiar with Perl but got around to using the GetOpt module. One of my inputs strings contains a '-' character, but I don't want the GetOpt to parse it.

    eg.

    my_perl_file -x "-number 1 -string abc"

    GetOptions("h"= >\$hflag,
    "x:s", \$user_prop);

    I want the GetOpt to get $user_prop as "-number 1 -string...
    See more | Go to post

  • jerinjoy
    started a topic overriding new operator with extra parameters
    in C

    overriding new operator with extra parameters

    I'm trying to track memory leaks by keeping track of the new and delete operators are called.

    I've declared new operator as:
    void* operator new (size_t size, const char *file, int line)
    {
    //code to store info abt the new call.
    }

    I want to define macros that can replace new and delete calls in existing code with a new that is passed object type, current line number and file name....
    See more | Go to post

  • jerinjoy
    replied to Random number generator
    in C
    use this:

    time_t seconds = time(NULL); //make sure this is declared at the beginning of the block
    srand(seconds);
    int a = rand();

    If you want to generate the same set of random numbers again and again then seed srand with the same number instead of seconds - ideally pass this as a command line argument or a define at the top of your code.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...