Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Search results for query: *

  1. BallenaEnFuego

    C++ String Manipulation Question

    Were you wanting to use std::string member functions? If so, there's one called find_last_of() that returns an index into the string of the last character or string that you send it: string str("\\ddata\\conf\\src\\bin\\d_5032.dat"),title; string::size_type idxslash,idxdot...
  2. BallenaEnFuego

    recursive functions and global variables

    How about: ============================================== function output=recursive_function(parameters) global idx; if (isempty(idx)), idx=1; else, idx=idx+1; end if (condition_is_met) recursive_function(parameters) end output=whatever...
  3. BallenaEnFuego

    Problems with GREP in Linux (Redhat 8.0)

    I think you want \< which matches the beginning of a word.
  4. BallenaEnFuego

    Problems with GREP in Linux (Redhat 8.0)

    I believe ^ matches the beginning of a line, not the beginning of a word.
  5. BallenaEnFuego

    recursive functions and global variables

    Couldn't the &quot;parent&quot; give the &quot;child&quot; its index? For example, the following case for calculating a factorial recursively: =============================================== function out=fact(N,pid) if (~exist('pid','var')) %first one if (~exist('N','var'))...
  6. BallenaEnFuego

    What is the relationship between co

    A constructor is a function that: *Has no return value *Is implicitly called when an object of that particular class is created It is generally good practice to have a destructor, even if you don't do anything in it. A destructor is necessary if you have any memory in the object that needs...
  7. BallenaEnFuego

    Overloading cast operator with pointers

    You can write iterators for each of your classes. Iterators are more typesafe than pointers, and casting can be overloaded easily.
  8. BallenaEnFuego

    .obj file format

    I'm answering my own question. Here's a link to Microsoft's Object File Format Specification: http://www.microsoft.com/hwdev/hardware/PECOFF.asp
  9. BallenaEnFuego

    random numbers

    rand() is pretty decent for generating a uniform random number. As for the not repeated part, I suggest using the STL class set<>.
  10. BallenaEnFuego

    .obj file format

    Anyone know where I can find info on the format of object files (particularly MSVC++ Debug & Release, as well as gcc)? I would like to develop a program that would output the function hierarchy given the .obj files in the project.
  11. BallenaEnFuego

    Matrix declaration in c-file for creating dll

    Do you want a_ptr & b_ptr to be matrices? Use the command: a_ptr=mxCreateDoubleMatrix(nrows,ncols,MX_REAL); Then you'll need to retreive a pointer to the mxArray to populate it with values (ap=mxGetPr(a_ptr)). The array is 1-D, so you can set index (2,3) to 1.1 with the command...
Back
Top