Duoas 1,025 Postaholic Featured Poster

According to the Delphi documentation, the TScreen.Fonts only lists "screen" fonts. You may want to also check in TPrinter.Fonts, as the font you want is technically for use with the printer...

Hope this helps.

Duoas 1,025 Postaholic Featured Poster

The .DFM file is linked into the executable as an RCDATA resource, which is just a compressed text version of the .DFM file (a few versions of Delphi save the DFM in compressed format, but most do plain text).

The Classes unit is all about loading and saving DFM data.

Duoas 1,025 Postaholic Featured Poster

I agree with AD that the FTP is probably what is going wrong.

FTP defaults to text mode. You must explicitly set it to binary mode before copying files.

tux4life commented: Yes. +12
Duoas 1,025 Postaholic Featured Poster

What are you writing? An OS?

We're not a translation service. You may want to try the Looking to Hire forum.

Duoas 1,025 Postaholic Featured Poster

I don't currently have access to Solaris ATM... alas, but perhaps it is something as simple as needing a blank line after each target:

CC = cc

run: driver.o
	CC -o run driver.o

driver.o: driver.cpp
	CC -c driver.cpp

BTW, you can have tabs in the forum message boxes, but you have to cut and paste them in... ;) (So you can just cut and paste this code block into a file and it would work.)

The CC is a makefile macro. Sun's compiler is "cc". (I think...)

Hope this helps.

Duoas 1,025 Postaholic Featured Poster

The wait() function monitors the state of a process, not its I/O streams. What you really want is the poll() or select() function.

It also seems that you want unbuffered input on your end of the pipe. See termios(3) for more.

See also poll(3) and select(3) for good reading on how these functions are used.

Hope this helps.

Salem commented: Some good old fashioned RTM - excellent +29
Duoas 1,025 Postaholic Featured Poster

Alas, the OP want's to know how to insert those obnoxious commas (,) in between digits.

Remember to use integer division and modulo (remainder) to split numbers apart ( / and % ).
For example:

1492 % 10 --> 2
1492 / 10 --> 149

149 % 10 --> 9
149 / 10 --> 14

etc

Then, to convert each digit you peel off into a number, just use the following kind of code:

int number = 7;
char digit = (char)number + '0';

Now think about how recursive functions work. In your case, you'll have to do three somethings, recurse, and then print stuff.

Hope this helps.

Duoas 1,025 Postaholic Featured Poster

Alas, I just googled it.

Try searching for things like "bresenham line circle ellipse algorithm".

Speed comes from doing the least to draw individual pixels. Hence, a lot of optimization comes from low-level accesses. In modern GUI architectures, often the case is for pixel access to occur in memory (in-memory bitmaps/pixmaps and the like), and then have the WM/OS/whatever copy the image to the graphics hardware. When you move to more direct accesses (like DirectX, etc.) then you must minimize accesses to the hardware yourself -- since it is slower than normal memory accesses.

Hope this helps.

Salem commented: Sounds good to me +29
Duoas 1,025 Postaholic Featured Poster

In Pascal, a semicolon separates statements (and terminates directives).

So the following is correct:

program Hello;  { Semicolon terminates directive }
begin
  writeln( 'Hello world!' )  { No semicolon necessary }
end.

As is:

program Hello;
begin
  write( 'Hello ' )
  ;  { semicolon separates statements }
  writeln( 'world!' )
end.

Since an if then..else block is one statement, there should not be any semicolons between the 'then' and 'else' parts:

if prime( users_number )
  then writeln( users_number, ' is prime.' )  { statement not ended }
  else writeln( users_number, ' is composite.' );  { now it is at the end }

Even nested ifs must obey:

if foo
  then if bar
         then baz
         else
  else quux;

Notice how if foo is true but bar is not, there is an empty statement there (or not there - depending on how you look at it ;) ).

This is the same in code like:

begin
  writeln( 'Woah, there are actually TWO statements here.' );
end.

Hope this helps.

Duoas 1,025 Postaholic Featured Poster

Hey there, he has good reason for hating Solaris.

Make sure you are compiling with the GCC and not the Sun Studio CC. Also make sure you have the GNU make (gmake) installed and use it by default instead of the Sun's make.
Finally, check that the shared libraries are actually compatible.

If you stick with the GCC you shouldn't have too much trouble making things work properly. If your professor refuses to use the GCC, your options are to take it up with the university's computer sciences department or to identify and strip everything GCC-specific from your code. That might just take an afternoon or two sitting in one of the school's computer labs.

Good luck!

Duoas 1,025 Postaholic Featured Poster
Duoas 1,025 Postaholic Featured Poster

Oy! Please don't use a vector (or any other STL container) to hold individual pixel data -- Just draw directly to the target surface.

Also, you needn't directly calculate every pixel in the circle. One quarter of them is sufficient. (That is, calculate 1/4 of the circle, and draw four pixels each step.)

Good luck!

Duoas 1,025 Postaholic Featured Poster

BP variants don't accept binary numbers.
Assemblers accept binary numbers.
Since Delphi has a built-in assembler, you can use binary numbers with the assembler -- but not in the normal Pascal code.

FlamingClaw -- that page is for a Pascal compiler which supports ISO-10206 (Extended Pascal), which is largely incompatible with Delphi variants.

m610 -- Just use hexadecimal. It is much easier on the eyes than binary anyway:

0000b = $0
0001b = $1
...
1001b = $9
1010b = $A
1011b = $B
...
1111b = $F

Hence, a large binary sequence can easily be represented with about a quarter of the characters in hexadecimal: $4A9F instead of 1000101010011111b Hope this helps.

Duoas 1,025 Postaholic Featured Poster

I'm sure your instructor has given you much more information than you have given us.

Make sure you review how to open pipes:
man 7 pipe: overview
man 2 pipe: create pipe manual page

And, for good measure, an article on Pipes and filters.


Your professor should have also given you instruction on how to create new processes - whether they be separate programs or simply separate parts of the same program using fork(). (I suspect that your professor has the popen() function in mind -- but I could be wrong.)


Opening and reading a file and writing a new file are both done with the standard fopen() function, as always.

The trick is that your first process will open the file, then write it through the pipe. The second process will read it from the pipe (its own standard input), modify it, and write it to the third process via yet another pipe. The third process opens the target file and writes what it receives from the second pipe (its standard input) to the file.

Hope this helps.

Duoas 1,025 Postaholic Featured Poster

Certainly.

SetConsoleTextAttribute()

Hope this helps.

Duoas 1,025 Postaholic Featured Poster

Choice of language often depends on one or more of the following

  1. Business requirements
  2. Applicability to the solution
  3. Programmer's choice

For a succinct listing of Python's strengths, see the Python About page.

Python can't do everything though. Sometimes you need to use a language that can. C++ is one of those that can.

Hope this helps.

Duoas 1,025 Postaholic Featured Poster

The best way to learn such things is to read the Python documentation.
Embedding Python in Another Application
Hope this helps.

Duoas 1,025 Postaholic Featured Poster

It might help to consider what two things you are doing.

1) input an array
2) return its sum

The main program should work something like

main()
  {
  sum = 0;
  while (user wishes to input an array)
    {
    sum += get_and_sum_array();
    }
  print sum;
  }

int get_and_sum_array() { ... }

To use fork, instead of calling a function to read and sum an array from the user, instead fork and return the sum via the exit status code. Keep in mind that the status code is limited in range. You could return the number other ways, but for your assignment just keep it simple and stupid.

Make sure to spend some time at the man pages for fork() and wait().

Good luck!

Duoas 1,025 Postaholic Featured Poster

A structure is 'aligned' in memory to make it easy to access quickly. Search your compiler's documentation for "record alignment".

Hope this helps.

Duoas 1,025 Postaholic Featured Poster

Looks like it is being stupid about alignment?

Duoas 1,025 Postaholic Featured Poster

Lousy timeout...

You don't actually have to fork(), just poll() or select() on the appropriate channels.

As for cin -- that is, by default, a line-buffered input (meaning, it blocks until the user presses the Enter key).

Making the standard input non-blocking and reading it is not trivial in *nix. A simpler solution would be to poll()/select() on stdin as well, and only block so long as it takes the user to press the Enter key.

Another option would be to fork() a new process whose only purpose is to wait on user input (via cin), and when it is received just to send the input (as a message) to the main process.

If undaunted, you can use tcsetattr() to turn off line buffering. Just be sure to turn it back on before your program terminates or your users will hate you. Also take a look through Understanding UNIX termios VMIN and VTIME

// Warning, I'm not at home at the moment and
// I have not tested this code. As it has been a
// few months since I've done anything like this,
// be warned.

#include <termios.h>
#include <unistd.h>

struct char_buffered
  {
  struct termios initial_settings;

  char_buffered( bool echo = true )
    {
    struct termios settings;
    tcgetattr( STDIN_FILENO, &initial_settings );
    settings = initial_settings;

    // Get one character at a time
    settings.c_cc[ VMIN  ] = 0;
    settings.c_cc[ VTIME ] = 18;

    // Turn off line-editing characters (sorry, got to do it)
    settings.c_lflag &= ~(ICANON …
Duoas 1,025 Postaholic Featured Poster

Alas, you have little to look forward to. Unless you must decompile or reverse-engineer, you are typically better-off just rewriting the thing.

If undaunted, check out this About.com article about decompiling Delphi code.

Good luck.

Duoas 1,025 Postaholic Featured Poster

It is because you are reading input to random memory.
Line 24's num variable should be declared as:

char num[ 100 ];

(Where '100' is just the maximum number of character's I'd accept from the user.)

Also, please avoid use of the gets() function. Your instructor should not be teaching people to use it. (It is a very poorly designed function that should never be used! No kidding!)

Use fgets() instead.

You can also roll your own getline-type function. See mine here
http://www.cplusplus.com/forum/beginner/4174/page1.html#msg18271

[edit]
Also, avoid using the ternary operator ( ?: ) for top-level constructs. Use an if..else instead.

And main() is [b]int[/b] main() Hope this helps.

Duoas 1,025 Postaholic Featured Poster

LOL yeah, on bootlegged NT 4+ systems... XD

Duoas 1,025 Postaholic Featured Poster

Don't learn MFC if you can avoid it. ;)

If you aren't using Windows (or even if you are and want more choices) check out The GUI Toolkit, Framework Page.

wxWidgets, GTK, and FLTK are the usual favorites.

Hope this helps.

Duoas 1,025 Postaholic Featured Poster

No.

Automatic variables are freed:

int foo()
  {
  int a = 42;
  int* p = (int*)malloc( sizeof( int ) );

  *p = a;

  return a;
  }

Once foo() returns, the automatic variables a (an int) and p (a pointer) are freed, but the heap variable created on line four still exists.

Remember, malloc() creates stuff that has no name. We only have its address (stored in the variable p). By dereferencing p we can access that unnamed value: printf( "%d\n", *p ); Every time you create something on the heap, you must also explicitly free() it.

Here's another example that might help:

#include <stdio.h>
#include <stdlib.h>

int main()
  {
  int* p;
  p = (int*)malloc( sizeof( int ) );
  *p = 42;

  printf( "The address of the local (automatic) variable p is %p\n", &p );
  printf( "The address of the heap variable is %p\n\n", p );

  printf( "The value of the local variable is %08X (%d)\n",  p,  p );
  printf( "The value of the heap variable is %08X (%d)\n",  *p, *p );

  free( p );
  return 0;
  }

Notice that p's value is the address (or location) of the heap variable.

Hope this helps.

[edit]
Oh, and a static local variable is just another way of making a global automatic variable. So

int next_foo()
  {
  static int my_foo = 0;
  return ++my_foo;
  }

is very much the same as

int my_foo = 0;
int next_foo()
  {
  return ++my_foo;
  }

The only …

Duoas 1,025 Postaholic Featured Poster

Why do you want to do that?
(In other words, unless you are writing a full-screen text application like an editor or video game, don't do that.)

Otherwise, on Windows, see Example Two

On Unix/Linux/POSIX:

#include <unistd.h>
#include <term.h>

void clearscreen()
  {
  if (!cur_term)
    {
    int success;
    setupterm( NULL, STDOUT_FILENO, &success );
    if (success <= 0) return;
    }
  putp( tigetstr( "clear" ) );
  }

You'll need to link with one of the following (depending on your system):
-lcurses
-lncurses
-lterminfo

If you are writing a CUI application, though, you should just use Curses directly:

PDCurses
Windows, DOS, OS/2, Plan 9, etc
http://pdcurses.sourceforge.net/

NCurses
POSIX systems, Mac OS X, etc
http://www.gnu.org/software/ncurses/

Getting started
http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/
http://web.cs.mun.ca/~rod/ncurses/ncurses.html

Hope this helps.

Duoas 1,025 Postaholic Featured Poster

I just can't fathom why truly brain-dead things like system("PAUSE") keep being taught.

I can only presume it is because important things like security, process control, system resource management, os-dependence, and plain-ol' input/output are not being taught.

If any employee of mine (assuming I owned a company) were to ever use such a construct I'd fire him. Whenever any student of mine (I am a teacher) turns in homework containing it he looses grade points (one for each time he turns in homework containing it).

Oh, apparently I also have to mention that this thread is over a year old...


(I regret having ever suggested that it can be used for any reason at all... even stupid stuff.)

Makes me want to unplug your computer with a pair of dikes.

StuXYZ commented: Sanity when teaching ! Thx! +4
Duoas 1,025 Postaholic Featured Poster

Pattern recognition and image analysis is a complex subject. You are better-off hiring someone to do it.

Good luck!

Duoas 1,025 Postaholic Featured Poster

>So there's absolutely no way possible for the average person to write to it?
No.

>I was just curious, I absolutely do not want to make any type of virus, trojan, or malware.
Anything that deliberately harms your system is, by definition, malware.

Seriously, you'd get more entertainment by using a sledgehammer or just defenestrating it from some tall office building.

Duoas 1,025 Postaholic Featured Poster

The documentation for rename() plainly states that if a file with the new name already exists, results are implementation-defined. You are better off deleting any existing 'new name' file first.

The problem with eof() is more insidious. Imagine what would happen to his code if an error flag were set in the middle of that loop. (An infinite loop.)

Always check against good(), and if that fails, you can check to see which flag caused the failure: whether a benign (and wanted) eof() or an obnoxious bad() or fail() of some sort.

Ctrl-D is the EOF character on *nix and in ASCII (EOT).
Ctrl-Z is considered an EOF character on DOS.
However, all this is system dependent and you should not generally see these characters when doing file I/O --as EOF is technically a condition, not a part of a stream.

Hope this helps.

Duoas 1,025 Postaholic Featured Poster

First off, you are being a bit pushy. Stop. Sometimes it takes a day or two to get a (useful) answer.

Secondly, if you can't use C++, then you are posting in the wrong forum.


A good DLL to play around with is C:\WINDOWS\system32\comdlg32.dll. You can use the functions in there. They run the gamut from simple to not-so-simple to use. See http://msdn.microsoft.com/en-us/library/ms645524(VS.85).aspx for complete documentation.

Good luck!

[edit] Most DLLs are not programming language-specific. Those that are are only useful to the application that bundles them. Hence, any DLL ought to do. [/edit]

Duoas 1,025 Postaholic Featured Poster

No.

The kernel is write-protected and you have to know the right magic to get past that.

Deliberately crashing the kernel isn't funny. It is downright dangerous. You can utterly destroy your system and loose data.

Duoas 1,025 Postaholic Featured Poster

Hmm, you are right. My TP4 and TP5.5 both barf on both @x and addr(x).

This is one of those (relatively few) things that Borland did wrong (stunting the language). Alas. The only to make things work right with both FPC and TP is to use some conditional magic:

begin
{$ifdef FPC}
  bill( @jim )
{$else}
  bill( jim )
{$endif}
end.

Sorry about that. Hope this helps.

Duoas 1,025 Postaholic Featured Poster

I don't know how you have your script set up, but the [Tasks] and [Components] sections are specifically designed for this. Every "task" you list in the tasks section indicates some component to install.

The Inno Setup Help documentation is very complete, and gives examples. You have to stare at it a little while, but it is actually pretty simple. Read the section on installation order to see where stuff fits in. Understanding that section is the key to understanding how to modify the script.

If you must do it in code, take a look through the event and support functions. (It is worth your time to read the entire Pascal Scripting section though.)

Hope this helps.

Duoas 1,025 Postaholic Featured Poster

It isn't a bug. Free Pascal is a little more strict about certain things than TP.
Your program should read:

program fred;

type funcparam=function(x:real):real;

function jim(x:real):real;
  begin
  jim:=x
  end;

procedure bill(func:funcparam);
  begin
  writeln(func(3):5:2);
  end;

begin
bill(@jim);  { Notice that I am getting the address of the function 'jim' }
end.

This will compile properly in TP also.

Hope this helps.

Duoas 1,025 Postaholic Featured Poster

Sorry I've missed the last week (more or less).

To do fancy stuff with the console use the Curses library.

NCurses
Platform: POSIX
Where: http://www.gnu.org/software/ncurses/
Notes:
If you are using Unix, chances are you have already got NCurses installed.
If you are on Linux, you will probably need to sudo apt-get install ncurses-dev (or whatever your equivalent is).
Link with:
normal systems: -lcurses Solaris: -lncurses

PDCurses
Platform: DOS, Win32, OS/2, Plan 9, ...
Where: http://pdcurses.sourceforge.net/
Notes:
It works well with any PC compiler, but you can get precompiled binaries that work with MinGW over at their sourceforge download site.
Link with: -lpdcurses PDCurses is a port of NCurses, but there are some small differences. If you stay away from extras like window-resize notification and mouse-handling then you'll have no troubles.

The NCurses Programming HOWTO

Hope this helps.

Duoas 1,025 Postaholic Featured Poster

Sigh. You know, you really shouldn't be dinking with the screen at all. But if all you want is something to clear the screen in Win32 and POSIX, here are a couple of functions. Your teacher will know you didn't write them yourself!

// clearscreen.cpp

#include <iostream>
#include <string>

#if defined(__WIN32__) || defined(__WIN32) || defined(_WIN32) || defined(WIN32) || defined(__TOS_WIN__) || defined(__WINDOWS__)
  #ifndef __WIN32__
    #define __WIN32__
  #endif
  #include <windows.h>
#else
  #include <unistd.h>
  #ifdef _POSIX_VERSION
    #ifndef __UNIX__
      #define __UNIX__
    #endif
    #include <term.h>
  #endif
#endif

#if !defined(__WIN32__) && !defined(__UNIX__)
  #warning Works best on a Windows or POSIX platform.
#endif

void clearscreen()
  {
  #if defined(__WIN32__)

    HANDLE                     hStdOut;
    CONSOLE_SCREEN_BUFFER_INFO csbi;
    DWORD                      count;
    DWORD                      cellCount;
    COORD                      homeCoords = { 0, 0 };

    hStdOut = GetStdHandle( STD_OUTPUT_HANDLE );
    if (hStdOut == INVALID_HANDLE_VALUE) return;

    /* Get the number of cells in the current buffer */
    if (!GetConsoleScreenBufferInfo( hStdOut, &csbi )) return;
    cellCount = csbi.dwSize.X *csbi.dwSize.Y;

    /* Fill the entire buffer with spaces */
    if (!FillConsoleOutputCharacter(
      hStdOut,
      (TCHAR) ' ',
      cellCount,
      homeCoords,
      &count
      )) return;

    /* Fill the entire buffer with the current colors and attributes */
    if (!FillConsoleOutputAttribute(
      hStdOut,
      csbi.wAttributes,
      cellCount,
      homeCoords,
      &count
      )) return;

    /* Move the cursor home */
    SetConsoleCursorPosition( hStdOut, homeCoords );

  #elif defined(__UNIX__)

    static char* console_clearscreen = 0;
    if (!console_clearscreen)
      {
      int result;
      setupterm( NULL, STDOUT_FILENO, &result );
      if (result > 0)
        console_clearscreen = tigetstr( "clear" );
      }
    if (console_clearscreen)
      putp( console_clearscreen );

  #else
    std::cout << std::string( 100, '\n' );
  #endif
  }

// end clearscreen.cpp
// clearscreen.hpp

#ifndef CLEARSCREEN_HPP
#define CLEARSCREEN_HPP

void …
Duoas 1,025 Postaholic Featured Poster

If this is just some homework problem, you could try one, then the other. Only one will work:

if (system( "clear" )) system( "cls" );

However, like ArkM said, better to do it the Right Way.

Duoas 1,025 Postaholic Featured Poster

The exact macro to test for depends on OS and compiler. Here is a handy reference for Pre-defined C/C++ Compiler Macros.

Unless you have been careful to predefine specific macros in your makefiles as AD instructed, you should test for all the possible macros that you might expect. On Windows, I usually have something like

#if defined(__WIN32__) || defined(__WIN32) || defined(_WIN32) || defined(WIN32)
  #define __WIN32__
#endif

...

#ifdef __WIN32__
  // windows stuff here
#elif defined( ... )
  // other stuff here
#else
  // generic stuff here
#endif

Hope this helps.

Duoas 1,025 Postaholic Featured Poster

I think the OP is interested in unbuffered input.

Win32: use <conio.h> stuff ([sub]me goes to wash my hands[/sub]) or the Win32 Console Functions to set the input console mode to 0 and read a single key. (Don't forget to restore the console mode to what it was before!) You can WaitForSingleObject() on the input console handle if you want to test for keypresses.

On POSIX systems, you'd also have to set the console mode to unbuffered (or "raw"), but the code to do that is more than I want to type-in right now, so see option 3:

For cross-platform stuff, use the Curses library.

  • NCurses
    POSIX systems: Linux, Unix, Minix, etc.
    (If you are on Unix, chances are it is already installed. If you are on Linux, sudo apt-get ncurses-dev or whatever your equivalent is.)
  • PDCurses
    Ported for Win32, DOS, OS/2, Plan 9, Nintendo DS, etc.

As long as you stay away from stuff like mouse-handling (via curses) and window-resize notifications your curses programs should recompile without difficulty on either platform. Don't forget to link with -lcurses (or if you are on Solaris, -lncurses ). [edit] oh, and on Windows, with -lpdcurses . [/edit]

I just posted a short example on curses here (another forum, alas. Sooner or later I'm going to post a comprehensive "How to <X> the console" tutorial).

Good luck!

Duoas 1,025 Postaholic Featured Poster

You can't. The main() function is, by definition, the first function your program runs.

What difference does it make? Just call your function first thing in main:

int main()
  {
  my_init_func();

  ...

Hope this helps.

Duoas 1,025 Postaholic Featured Poster
Duoas 1,025 Postaholic Featured Poster

I think you'll have to go ask your professor for clarification. Sorry.

Oh, the bit position is indexed like an element of an array. So if your bits do represent strings (as in vector <string> values; ), then bit zero represents values[ 0 ], bit 1 represents values[ 1 ], etc. A set of those values is then just a number.

(also, I hope you realize that I added spaces in the number for readability: 00 0011 1111 instead of 0000111111).

Duoas 1,025 Postaholic Featured Poster

Yes, you really are asking an OS and SDK-dependent question.

If you are using something like SDL, then respond to the key events that SDL gives you. Most GUI/graphics toolkits will give you a way to hook into keyboard events.

If you are using straight Win32, look for WM_KEYDOWN events in your message loop.

If you are using X, make sure you have selected an appropriate KeyPressMask and watch for KeyPress events in your main event loop.

If you are using something else, please let us know.

Alex Edwards commented: I knew it - thanks for the thorough explanation =) +4
Duoas 1,025 Postaholic Featured Poster

Good grief. Only use TerminateProcess() to kill the unruly.

Otherwise, just ask it nicely: send it a WM_CLOSE message. If it doesn't respond in, say, 500 ms or so, use CreateRemoteThread() and ExitProcess(). If it still doesn't quit after another half-second or so, then swat it with TerminateProcess().

Hope this helps.

Salem commented: Much better ideas +21
Duoas 1,025 Postaholic Featured Poster

Your assignment is the kind of exactingly vague description I've come to expect from CS instructors. Do you have an exemplar of the input file? I will assume some things from here on:

A bit string is more commonly called a binary number (integer types).

Hence, the number "10" is the bitstring 1010 (msb to lsb).
For a number, the bits and values are:

{bit 0} = {2^{0}} = 1\\
{bit 1} = {2^{1}} = 2\\
{bit 2} = {2^{2}} = 4\\
{bit 3} = {2^{3}} = 8

etc, so 1010 is 8 + 0 + 2 + 0 = 10.
(Sorry, the LATEX capabilities on the forum are very basic.)

You don't have to associate powers of two with each bit. You can associate other things instead. For example:

"I eat green eggs and ham":
bit 0 = "I"
bit 1 = "eat"
bit 2 = "green"
bit 3 = "eggs"
bit 4 = "and"
bit 5 = "ham"

So the sentence could be represented as 00 0011 1111 (read that from right to left).
Let's add another:

"I don't like green eggs and ham, Sam I am"
bit 6 = "don't"
bit 7 = "like"
bit 8 = "Sam"
bit 9 = "am"

Notice how we didn't need to assign new bits for values that are already associated with a particular bit. The second sentence would then be: 11 1111 1101 . Notice how that …

Duoas 1,025 Postaholic Featured Poster

You'll need to create a system snapshot and walk the processes and modules.
MSDN Tool Help Library

If you don't need to do it programmatically, you might want to check out Cedrick Collomb's Unlocker.

If you are trying to dink with system DLLs, there is a reason they are protected. If you are sure you know what you are doing though, check out Replacer. (It is a good tool despite the dilapidated webpage.)

Good luck!

Duoas 1,025 Postaholic Featured Poster

You won't get any source... and you'll have to read your textbook, but think for a moment:

Should objects in shared memory be referencing things in the private memory of any process or thread?

Hope this helps.

Duoas 1,025 Postaholic Featured Poster

This is one of those perennial questions...

system() returns the exit code of the command shell (probably bash --or if your system is really old, sh [check your /usr/bin/sh to see if it is a link to bash or not if you want to know]).
Only if your libc was made in an abnormal way will system() execute the program directly.

I've answered this before with a little module. (Alas, it is on another forum.)
Duoas's ExecProcess class
Post size is limited there, so keep scrolling for both files.

If you are new to C++ in general the following link may also be good reading.
Call external program in C++ (Linux) by Hannahlv

Hope this helps.