15,300 Posted Topics
Re: Use your compiler's debugger and single step through the program to find out what the problem is. You can also put print statements around the program so that you can see the value of various variables. line 65: for (int column = 0; column < 5; column++) Why 5? why … | |
Re: The problem is line 8 of the header file. Delete that semicolon at the end of the class name. Otherwise it looks to be ok. >> it is generally inadvisable to have code (as opposed to declarations) in a header file He has inline code, which is perfectly acceptable and … | |
Re: You need to learn how to use your compiler's debugger so that you can single step through your program and find out for yourself what is causing the problem. That will save you lots and lots of time | |
Re: Never declare data objects in a header file because if you include the same header file in multiple *.c or *.cpp files the compiler will generate multiple declaration errors. So you want to move lines 12 - 17 of that header file into the *.c file (about line 7). | |
Re: Where is your program? We are not going to write it for you. But as a hint: Save a copy of the initial node pointer so that as the program iterates through the nodes it knows where it started. | |
Re: >>Also on a side note what part of the memory is the realtime screen data stored Depends on what operating system you are talking about. MS-DOS Version 6.X and older was stored at address 0x8000:0000, and graphics memory at 0xA000:0000 (or something like that, I'm recalling from over 20 years … | |
Re: lines 37 and 43: the friend functions need to return a value. Your compiler probably gave you a warning on this and you just ignored it. | |
Re: why don't you just call CreateProcess() in a loop and call it 10 times? | |
Re: Lots of different causes, one being your program may have scribbled something all over memory and damaged vector's memory space. Another problem could be bad use of pointers. Without knowing more details about the program its not possible to give you any really good answers to your question. One way … | |
Re: >>.can someone help me going with this coding? Yes, we can [b]help[/b], but we're not going to write it for you. | |
Re: Please post the entire code that will actually compile. That means adding all the parentheses, commas and semicolons, as well as the function. | |
Re: class nopdeType is expecting an integer, not a data type. Example: [icode]nodeType *n = new nodeType(5);[/icode] | |
Re: Sometimes the comma just acts as a separator instead of an operator. [URL="http://en.wikipedia.org/wiki/Comma_operator"]See this wiki article [/URL]for more details | |
Re: I don't know if this will work for you or not, but here is a suggestion update account set byprice = byprice * 2 where byprice < 20 | |
Re: Unlike C, C++ requires you to typecast the return value of functions that return void*, like malloc(). | |
Re: Change the packing factor to 1 and the alignment problem will go away. [icode]#pragma pack(1)[/icode] will not put holes in the structure. The pragma is compiler dependent, some compilers may do it differently. [code] #pragma pack(1) // your structure goes here #pragma pack() // revert to default [/code] | |
Re: Your program is writing the file in binary mode so you can't open it with a text editor such as Notepad.exe. | |
Re: Do you have a question, or are you just posting your awesome code? | |
Re: [QUOTE=mankamat;1102089]Hi, How do we read and write a byte array to a XML file in C++.[/QUOTE] Its very complex to do in c++ -- a lot simpler in VBA. But read [URL="http://msdn.microsoft.com/en-us/library/aa188489%28office.10%29.aspx"]these articles[/URL]. | |
Re: If you are using VB6 then you are using the wrong compiler. VB6 can not compile c or c++ code. | |
Re: You can not just arbitrarily remove __stdcall from the function prototypes because the DLL was compiled to use it. __stdcall is one of 5 calling conventions used by Microsoft (and probably others too) compilers. [URL="http://msdn.microsoft.com/en-us/library/984x0h58(v=VS.80).aspx"]Here[/URL] is a more in-depth thread about it. | |
Re: [QUOTE=moasi;1687091]I've tried codeblocks but it tends not to do anything when I hit compile, or build and run[/QUOTE] Then you did it wrong. I use Windows 7 and it works ok for me. Code::Blocks is only an IDE and requires a compiler such as MinGW of Microsoft's CL. There are … | |
Re: CreateProcess() isn't really all that difficult once you realize most parameters are 0. That function does not wait for the newly created process to finish. If you want that behavior then you have to call WaitForSingleObject() after calling CreateProcess(). [code] STARTUPINFO sinfo; PROCESS_INFORMATION pInfo; memset(&sinfo,0,sizeof(STARTUPINFO)); sinfo.cb = sizeof(STARTUPINFO); BOOL b … | |
Re: Well, I didn't like it either. It was very boring and the speaker was uninteresting to listen to (monotone). | |
Re: I would like to use a machine gun to go bird hunting. We have blackbirds that fly in herds of thousands. A machine gun would be just the thing to break them up :) | |
Re: The problem with using magic numbers to identify a file format is that the numbers may be just coincidental to the rest of the file. For example I might have a binary file whose first few bytes are 49 49 2A 00, but that doesn't mean its a TIF file. … | |
Re: Look at the string you are passing to LoadLibrary(). You are passing it the path but not the name of a library. | |
Re: Those numbers have nothing to do with the amount of memory occupied by all those strings. Its nothing more than the starting memory address of them. If you want to display the length of the strings then you have to call strlen(), such as [icode]printf("%d\n", strlen(argv[i]));[/icode] [edit]Oops! What ^^^ said … | |
Re: >>Yes, as far as I know, it shouldn't be a problem. (btw, I know that I am contradicting vijayan121 on this, he may be right, but I think not, I think he is being a bit over-cautious, ABI shouldn't be a problem here) >>If your DLL doesn't have the exports … | |
Re: Oh that sounds soooo familiar where I was working!! *!@**! testers! | |
Re: [QUOTE=josh_banned;1063294]It's funny 'cuz the IP they banned was one globally used by the University. Dani just banned an *entire* campus of potential clients. HAHAA![/QUOTE] What Dani banned Dani can unban. | |
Re: Your program needs additional error checking -- it works ok for me [code] #include <windows.h> #include <stdio.h> #include <io.h> #include <string.h> #pragma warning(disable: 4996) int main(void) { FILE *fd; int ok; HANDLE hFile; FILETIME createTime; FILETIME accessTime; FILETIME writeTime; fd = fopen("test.txt","a+"); fclose(fd); hFile = CreateFile((LPCTSTR)"test.txt", GENERIC_WRITE | GENERIC_READ, FILE_SHARE_WRITE … | |
Re: google for "c++ ReadRemoteRegistry" and you will find several threads, like [URL="http://stackoverflow.com/questions/6582843/c-qt-how-to-access-windows-registry-remotely"]this one[/URL] ![]() | |
Re: Do you want your program to do other things in the meantime? If you do, then put the alert messages in another thread, but your compiler may not support multi-threaded programs. So an alternative might be to use a loop [code] time_t t1, t2; // time variables double dif; t1 … | |
| |
Re: You need to capture one of the mouse events, such [URL="http://msdn.microsoft.com/en-us/library/windows/desktop/ms645608(v=vs.85).aspx"]WM_LBUTTONUP[/URL] On that page in MSDN you will also find links to all the other mouse events that you will want to study. | |
Re: >>int a = 0; You can not put that in a header file. extern variables are always declared in a *.c or *.cpp file. Put this in the header file [icode]extern int a;[/icode] | |
Re: you could convert it into struct tm that's declared in time.h then call mktime() to convert that structure into type time_t. | |
| |
Re: What exactly does "it doesn't work" mean? Error message(s)? make sure everything was compiled in release mode, not debug mode. | |
Re: >>}while(choice != 'n' || choice != 'N'); You need to use &&, not ||. | |
The St Louis Cardinals just won their 11th World Series Baseball championship against Texas Rangers. The final score was 6 to 2. The Cardinals are second only to New York Yankees for the most world series games won. The first one played was in 1903. Odd they call it the … | |
Re: call recv() twice, the first time to get just the first 4 bytes (assuming the size of the structure is at the beginning, and then again to get the rest of the structure. | |
Re: [code] temp = ArrOperand[counter]; static_cast<char>(temp); perm[i] = temp; [/code] Why all that hard work??? All you need is this: [icode]perm[i] = (char) ArrOperand[counter];[/icode] -- that is, assuming the values in ArrOperand can be held in a char variable. If not, then it won't work. | |
Re: line 19: use == (comparison) operator instead of = (assignment) operator | |
![]() | Re: You have already stated the items in the combo box -- Day, Afternoon, Night and Mixed. Do you know how to add those items to the combo box while in Form Designor? (In the comboBox Properties page scroll down to the Items Collection and you can add them there. See … |
Re: 40-60K is only starting salary. professionals with experience can often get a lot more than that. On the west coast (USA) you could easily get double that amount -- of course you will need it because it will cost tripple to live there :) | |
Re: You can not make the results of the C program permanent on the terminal. Like all other shell programs anything done within the program (or shell script) is destroyed when the program ends. | |
Re: [URL="http://msdn.microsoft.com/en-us/library/windows/desktop/ms683212(v=vs.85).aspx"]GetProcAddress[/URL]() probably returned a NULL pointer. [quote=MSDN]The spelling and case of a function name pointed to by lpProcName must be identical to that in the EXPORTS statement of the source DLL's module-definition (.def) file.[/quote] Notice the functions still must be exported. |
The End.