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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. melancthon

    multiple pointer dyn allocation

    >obislavu A good solution for your problem is to use a... Yes I had originally said that I would not do this the way that I did it, except that this approach relied on the general approach of the questioner. (Context sensitive, or something). I'm familiar with a variety of approaches here. You...
  2. melancthon

    how to print address of a string.

    No disrespect, but I can't understand your comment. Are you referring to the use or abuse of namespaces?
  3. melancthon

    multiple pointer dyn allocation

    Okay, I built some code that does what you say (however, I'm assuming that you want the input converted to binary int values, hence the sscanf conversion, cf. below). Note, I would not do this this way, I would use C++ STL containers for this. I particularly don't like the container methodology...
  4. melancthon

    multiple pointer dyn allocation

    Phew. I looked at this somewhat, and find it very confusing. I find both the code and the statement of requirements confusing. If you can be somewhat more specific, I will try to help. As far as the requirements go, are you looking for an array of characters that contain text representations...
  5. melancthon

    Memory overlay

    Correction to previous: result = result | d; // will return '7' i.e. 0111 < 0100 | 0011
  6. melancthon

    Memory overlay

    You don't want an OR, you want a LOR (logical or). A LOR will OR each bit into the result. Really a different thing from OR. Very simple example: unsigned long a = 2; // i.e. 0010 unsigned long b = 1; // i.e. 0001 unsigned long d = 4; // i.e. 0100 unsigned long result; result = a | b; //...
  7. melancthon

    how to print address of a string.

    Hmm. I'm inviting myself to discuss the previous post, which appears as a response to an earlier post of mine. I have to infer a little, since there are no comments. I think that there are three undesirable aspects to the adjustments that this last post made (I actually made my post to correct...
  8. melancthon

    #include question

    I'm not sure that the PATH environmental variable will work with all compilers (e.g. SUN FORTE). Most compliers provide a compiler command line switch that lets you add directories to the 'include search list'. Usually (YMMV) this is of the form: -I<directory name> lets you specify...
  9. melancthon

    how to print address of a string.

    Slicker solution, no? #include <iostream> #include <string> void process( void ) { char c[] = {&quot;GOOD&quot;}; std::string str = c; std::cout << '\&quot;' << str << &quot;\&quot; 0x&quot; << &str << &quot; 0x&quot; << &c << std::endl; printf (&quot;\&quot;%s\&quot; 0x%p\n&quot;, c, (void...

Part and Inventory Search

Back
Top