Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by Akarui

  1. Akarui

    C++ tokenizer

    >I want something more simple!! The problem with this program is that it will either be very long using simple concepts which will make it seem less simple, or very short using higher level concepts which will make it seem less simple. Instead of building the entire program from scratch, you...
  2. Akarui

    Pointer problems with (char*)

    >I was hoping to understand the pointer arrays, and mem allocation Pointer arrays are generally unsafe and error prone, you shouldn't need them much at all with the string and vector classes offered by C++. However, the basic idea is this: #include <iostream> #include <cstring> using namespace...
  3. Akarui

    Run script from script and sent and receive data

    Just use fork() to create another process.
  4. Akarui

    IPC using Perl

    Yes, both solutions work in Windows as well.
  5. Akarui

    Pointer problems with (char*)

    >struct            Vect*               vect;//This line I modified There's no need to use the struct keyword in C++, your modification does nothing except make the fact that Vect is a structure more explicit. >char name[]=&quot;&quot;;//This line I modified This isn't any better, name is now an...
  6. Akarui

    Pointer problems with (char*)

    >char *name; >cin >> name; and >char *entries; >// get the entries >cout << &quot;Enter Number of Entries: &quot;; >cin >> entries; Automatic pointers begin with garbage addresses. This means that you don't own the memory they point to. If you don't point them to a valid address then you'll...
  7. Akarui

    Simple DIE question

    >The above 'scalar' is unnecessary. True, but I like to be explicit. :)
  8. Akarui

    Simple DIE question

    Call die with a list and it'll be printed to STDERR, you don't need to call print as well. Also, when printing the list for die, if you end it with a newline then the Perl interpreter won't add anything, but if you omit the newline the interpreter will tack on the file, line, etc... Consider the...
  9. Akarui

    IPC using Perl

    It sounds like you just want a pipe. The easiest way is to pipe the output of the program to your Perl script from the command line when you call it: %perl script | prog An alternative if the parsing program is known is to open a file handle inside your script: #!usr/bin/perl -w open(PARSER...
  10. Akarui

    While loop

    Is it possible for you to just conditionally print what you want? while (my ($key, $value) = each(%emails)) { continue if $key == $time; ... } For multiple values just use another hash instead of a long string of elsif's while (my ($key, $value) = each(%emails)) { continue if...
  11. Akarui

    Dynamically allocating multidimensional arrays?

    The easiest, and less efficient way, would be to do this Thing::Thing(int row, int col) { ptr = new float*[row]; for (int i = 0; i < row; i++) ptr[i] = new float[col]; } However, this requires row + 1 calls to new. A better way that only calls new twice would be...
  12. Akarui

    &quot;Press any key to continue...&quot;

    Another alternative is to download the Term module from CPAN and use a ReadMode/ReadKey combination. #!usr/bin/perl -w use strict; use Term::ReadKey; sub pause(); print &quot;Test\n&quot;; pause; sub pause() { print &quot;Press any key to continue...&quot;; ReadMode 'cbreak'...

Part and Inventory Search

Back
Top