- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 8
- Posts with Upvotes
- 7
- Upvoting Members
- 4
- Downvotes Received
- 5
- Posts with Downvotes
- 2
- Downvoting Members
- 4
28 Posted Topics
Re: Coplien's "Advanced C++ Programming Styles and Idioms". This is the original book that shows how C++ was used in the years of testing and experimentation, before official release; how the language is designed to be used. It was published long before STL, Patterns, or Boost, so separate specialized sources are … | |
Re: Forget iostream. [code=cpp] #include <conio.h> #define IOFLUSH {while(_kbhit())_getch();} #define PAUSE {if(!_getch())_getch();} [/code] | |
Re: I would like to erase my user id and quit the community permanently. How do I do this? | |
Re: Can you run program on PC A ? Or, you only want to run program on PC B ? | |
Re: Often with counting/histogram problems, you can make an array of counters, one for every possible value you are counting. [code=cpp] #include <iostream> using namespace std; int main() { unsigned char uc = 'a'; // the unsigned version is just a non-negative number cout<< "the numerical value for '" << uc … | |
Re: firstPerson is right. Iterators are designed to work like array pointers. So, in C, you would say: [code=cpp] // this is standard C usage int a[10]; // the array we want to use int* begin = a; // end-pointer, to test when our pointer has gone too far int* end= … | |
Re: The key word is "Deployment". This is very difficult, even for professionals. Small companies have one deployment specialist. Big companies have a whole department. Microsoft Visual Studio does help you. 1. For SQL in small projects on one computer, there are two free options. One is called SQL-Compact. The other … | |
Re: If you really need to propagate the exception to global scope, you can add a String.Format: [code=cs] throw new System.InvalidOperationException( String.Format( "For {0} the maximum price allowed for a {1} page is {2}$" , book1.Title, book1.Pages, book1.Pages * 0.10) ); [/code] .. but, your basic handler might be enough. The … | |
Re: Named pipes will work. Nothing you said is wrong, so you will have to post code. The assumption that pipes are required for asynchrony is wrong though. Pipes have no relationship to asynchrony. You could do everything in one process without IPC (interprocess communication), by launching a thread from your … | |
Re: Windows programs are different from console programs in three important ways. 1. the 'main' function is hidden from you. Windows programs start with a function called "WinMain". Instead of you calling functions to use, a Windows program calls you when something happens. 2. Windows programs have no console display. The … | |
Re: Create a console project, and use #define WIN32_LEAN_AND_MEAN | |
Re: Check the DLL for corruption. Try switching your compile target (for every module you build) to 32-bit, rather than x64. Sometimes the compiler will default to build for the current processor, and this breaks libraries compiled for the older versions. | |
Re: The Eval function loops through tokens without remembering what it did last and returns a bool value rather than double. For parsing, there is no replacement for strtok, or something that does the same. So, you get the string, tokenize it into an array of small tokens. Then, you use … | |
Re: I'm not currently running a Unix build, but aren't msgrcv/msgsnd routines extremely sensitive to correct buffer size? What line, which call, causes the error? | |
Re: This gets some basic device information. [code=cpp] //handle to the drive to be examined HANDLE hDevice = CreateFile(TEXT("\\\\.\\G:"), //Drive to open GENERIC_READ|GENERIC_WRITE,//Access to the drive FILE_SHARE_READ|FILE_SHARE_WRITE,//Share mode NULL,//Security OPEN_EXISTING,0,// no file attributes NULL); if (hDevice == INVALID_HANDLE_VALUE)//Cannot open the drive return 0; CDROM_TOC val; // table of contents for a … | |
Re: I don't know of an automatic way. At Form-load, you have to open the file, read stuff into memory, create objects, and place them into the combobox. | |
Re: Two old, standard tools for compiler writing are lex and yacc, (flex/Bison for Windows). It's a profound topic. | |
Re: Almost certainly this is not a socket issue. What are the two applications? If it is C/C++ and you are using 'spawn', you need to use one of the 'p' suffix spawn variants. | |
Re: I think you are forking more threads than you intend. You realize that in each loop, you wait for the first thread, but fork three more, which all complete, and go back into the loop ? That's 3 * 3 * 3 *... a hundred times, or, 3 to the … | |
Re: CrazyDieter is right. This is not a language question. Every operating system has special functions which tell you about devices, and they are different for every system. In Windows, the functions for managed code in the .NET framework are different from the ones you use with regular code. | |
Re: Nice elegant function for 'palindrome'. Your string buffer is completely unprotected. Writing safe string code in C isn't too hard, but you have to change most of your function calls. First, if you allocate fixed arrays, 'sizeof' is your friend. [code=c] // use a reasonable buffer-size. RAM is cheap. Any … | |
Re: [code=c] const char* code_already_supplied_as_a_starting_point = 0; for(;;) { printf( "give me code " ); if( ! code_already_supplied_as_a_starting_point ) printf ("you first " ); } [/code] | |
Re: My system can't read the Word attachment. Word .doc files are virus vectors. You might want to post the math doc in hypertext. | |
Re: This is a problem of understanding memory allocation, and scope. As you probably know, class Instance variables (or "Properties", in the uselessly new parlance) are automatically allocated when you create a class object, and do not need to be separately declared: [code=cpp] class B { public: int k; // a … | |
Re: It sounds like a typical introductory programming assignment. No cheating! Just to get past language issues, here are some tips: An array of characters in most languages is called a "string". 1. a fixed, unchanging string in C/C++ can be declared like this: [code=c] static const char* fixed_array_of_characters= "fubar" ; … | |
Re: C/C++ logic is always just testing for zero. In C/C++, zero is false, anything else is true. [code=c] int i = 3; while ( i ) // test if i is non-zero { i= i-1; // this executes 3 times } [/code] One result of this is that the term … | |
Re: Your code runs without error on my Win7/vs2010 system, although the cdrom drive doesn't seem to do anything. This command is new. Your cdrom.sys driver may not have the new commands. For explanation of system errors, I find the following function useful: static inline void showError(const _TCHAR *source=0) { DWORD … |
The End.