15,300 Posted Topics
Re: I don't ever use malloc() in a c++ program, its just too confusing to mix malloc() and new together in the same c++ program. Stick with new for consistency and to be less error prone. | |
Re: homework problem??? If so, then study about function pointers (or pointers to functions). Once you understand that then you will have the answer to your question. | |
Re: There is nothing wrong with the for loop on line 25. What exactly do you want help with? (hint: you need to do more calculations within that loop. can't be done all on one line.) | |
![]() | Re: [quote][URL="http://en.wikipedia.org/wiki/Diwali"]Today it is celebrated by Hindus, Jains and Sikhs across the globe as the "Festival of Light," where the lights or lamps signify victory of good over the evil within every human being[/URL][/quote] The description sounds like its a very nice celebration, but I'm a little werry about the above … |
Re: copy the DLL into any of the folders listed in the PATH environment variable and it will work regardless of where the application program is located. | |
Re: define it as a pointer and allocate memory to it at runtime [icode]MyArray DWORD 0[/icode] Exact syntax will depend on the assembler and computer you are using. And if Intel will depend on the memory model. | |
Re: _T is a macro that converts a quoted string leteral to wide character, such as [icode]wchar_t something[] = _T("Hello World");[/icode] Never heard of _RT macro, and its not defined in tchar.h, where _T is declared. | |
Re: Start out your program very simply, just create a program that does nothing more than read each line of the file and display them on the console screen. Once you have that compiled and working correctly you can add additional code to make the program behave as you have described. … | |
Re: check your computer's file system to see if alleg42.dll exists? If it does, is it in one of the folders listed in the PATH environment variable? | |
Re: Maybe you need to lean how to search MSDN for what you want? Such as [URL="http://msdn.microsoft.com/en-us/library/windows/desktop/ms647624(v=vs.85).aspx"]CreteMenu[/URL]() Or read [URL="http://winprog.org/tutorial/"]a tutorial[/URL] [code] HWND hw = CreateWindowEx(x,x,x,x,(HMENU),x,x,x), [/code] The above line does not create a menu. It creates a window that contains a menu. | |
Re: There is no such thing as an "assembly compiler". Assembly programs are not compiled. They are just assembled. Two good assemblers for MS-Windows os -- MASM (a Microsoft assembler) and TASM (a Borland assembler) When you write assembly you are expected to "know your stuff" and not be spoon fed. … | |
Re: I used Windows 7 and did not have a problem with that code snippet, [code] #include <string> using std::string; int main(int argc, char**argv) { string arg1 = "one"; string arg2 = "two"; string command = "matlab -nosplash -r MyMatlabScript(" + arg1 + " " + arg2 + ");"; system(command.c_str()); } … | |
Re: Depends on what you are programming? *nix? MS-Windows? QT? there are lots of others too. You need to be a lot more specific about what you are coding. | |
Re: Depends on where you live and what kind of landline phone you have. I have a cordless phone and the phone number shows up on its display. But you will have to get with the manufacturer of your phone to find out how it works. | |
Re: cross posted [URL="http://forum.codecall.net/c-c/41323-linked-lists-type-justification.html"]here[/URL] | |
Re: Maybe you should be reading [URL="http://www.tenouk.com/ModuleO.html"]a tutorial[/URL] | |
Re: line 12: you can't use cin >> operator for strings that contain white space (space or tabs). To do that you have to call getline(), e.g. [icode]getline(cin,str1);[/icode] | |
Re: I always enjoyed programming, especially the satisfaction of the many achievements working out problems. I only do things I like doing and leave the other tasks up to someone else because not only do I not like doing them but I'm woefully inept at the jobs. I didn't realize that … | |
![]() | Re: maybe you needed to clear your browser's catch. Usually works for me. |
Re: VC++ does the same thing. Just click the error message and the cursor will be moved to the offending line in the editor. | |
Re: It would also mean a 2 dimensional array. But I'd have to know what "...bla bla ..." says | |
Re: Salem already tried to help you in [URL="http://www.daniweb.com/forums/thread120491.html"]this thread[/URL]. If you can not understand the code he showed you then what you want to do is way beyond your current level of C knowledge. You probably need to study some tutorials about FILE and associated functions before attempting to continue … | |
Re: There are also other subtle differences. A program that runs ok when compiled in Debug mode may be broken when compiled in Release mode. One reason for that behavior is the way the compiler allocates memory for variables when compiled for Debug. Another reason may be over optimization in Release … | |
Re: To copy to another location, open the file in binary mode then read/write 255 bytes at a time until end-of-file is reached. Another way to do it on MS-Windows is call win32 api function [URL="http://msdn.microsoft.com/en-us/library/windows/desktop/aa363851(v=vs.85).aspx"]CopyFile()[/URL] | |
Re: It will depend on the compiler and operating system. Tell us what you are using so that we can be more help. | |
Re: This works. First you have to export the functions in the DLL that you want to expose to the application program. Here I defined a macro named ADDITIONCLASSAPI so that the same *.h file can be used in both the DLL and application program without change. VC++ 2010 (and earlier … | |
Re: have you read [URL="http://www.w3schools.com/sql/sql_insert.asp"]this[/URL] tutorial? Not sure, but I think the INSERT statement is incorrect [icode]QLExecute ("INSERT INTO tblDownloads (DownloadIP , DownloadCount) VALUES('173.201.216.2', 1);");[/icode] | |
Re: They are not related. DLLs can contain [URL="http://www.microsoft.com/com/default.mspx"]COM programming[/URL]. | |
Re: How many characters are on each of the lines in the file? Just 2 characters per line? That's all your program is reading. Post the first few lines of the text file so that we can see what's wrong with your program. | |
Re: Check the WM_CREATE switch statement in WinProc() to see if the buttons are greyed out there. | |
Re: g++ probably outputs error messages to stderr instead of stdout. try this: g++ "C:\HelloWorld.cpp" 2> "C:\output.txt" [edit]Oops! too late. ^^^ is right[/edit] | |
Re: srand() is used to seed the random number generator [icode]srand( time(0));[/icode] calling time() will make srand() seed with a different number each time the program is run. There is no such thing as an infinite character. | |
Re: Here is one way to convert it to integer. It may not work correctly if the string contains non-numeric digits so you will have to add some error checking. [code] #include <Windows.h> #include <iostream> #include <tchar.h> int _tmain(int argc, _TCHAR* argv[]) { BSTR bstrTemp = L"56"; int x = 0; … | |
Re: A program doesn't know how it was launched. Another program could have launched it by calling one of several C functions, such as CreateProcess(), system(), ShellExecute(), etc. Or it could be launched by some other non-C program using functions available to it for that purpose. | |
Re: >>Anyone on daniweb now but not using a laptop I never use a laptop -- hate them. I just use a regular HP PC. | |
Re: >>char date of birth[15] There can not be spaces in the object names. One way to code it is to replace spaces with _ character [icode]char date_of_birth[15][/icode] | |
Re: >>I wonder what version of Windows Microsoft depreciated del *.* from the terminal. What makes you think it was depreciated? That command is still alive and well in Windows 7. | |
Re: My guess is that a semaphore is just a system DWORD since all it does is count from 0 to some maximum value. See [URL="http://msdn.microsoft.com/en-us/library/windows/desktop/ms685129(v=vs.85).aspx"]this link[/URL] | |
Re: seek to end of file, then get the file pointer. If 0, its an empty file. How to do that depends on whether you want to use fstream or FILE. | |
Re: lines 16 and 18 are wrong, you are passing a pointer to a single character not the whole string. Here's how to code it [icode]scanf ("%s", name[i]);[/icode] | |
Re: you might find some stff [URL="http://www.codexxi.com/"]here[/URL]. Those old games you mentioned probably won't run on Vista or Windows 7 without also running [URL="http://www.dosbox.com/"]DosBox[/URL] | |
Re: code between [icode]ifdef _cplusplus[/icode] and [icode]endif[/icode] require c++ compiler, such as make sure the file has *.cpp extension. If you are using a C compiler only then you can't make it compile that c++ code. I don't know a thing about your other question. | |
Re: [QUOTE=NathanOliver;1670615]An array's size is only limited to the memory of the machine running the code. [/QUOTE] It would be limited to the sizeof(std::size_t) See definition of the [URL="http://www.cplusplus.com/reference/std/new/operator%20new/"]new operator[/URL] | |
Re: What is "basics until array" exactly? We don't have your textbook so we have no clue what that means. I can guess, but that won't be much help to you. | |
Re: I like to use [b]wcstombs()[/b] because it is pretty easy to use. There are, however, other more powerful fuctions that may be better used for some languages such as Chinese. | |
Re: use single quotes, not double quotes. Surround single characters with single quotes. t[0] = 'h'; | |
Re: He was a brilliant man, I learned a great deal from his books and lectures. |
The End.