15,300 Posted Topics
Re: Thanks for bumping a thread that's been dead for six years. ;) ![]() | |
Re: Here is a solution using inline assembly in c program [code] #include <iostream> using namespace std; int main(int argc, char* argv[]) { char s1[] = "Hello World"; char s2[255] = {0}; int len = 0; _asm { push esi push edi lea esi,s1 lea edi,s2 ; get length of string … | |
Re: Since URL is std::string you have to use its c_str() method [code] void openURL (string& URL){ ShellExecute(NULL, "open", URL.c_str(), NULL, NULL, SW_SHOWNORMAL); }[/code] | |
Re: Post what you have done so far to resolve this. What compiler and operating system are you using, because it will make a difference how you create the threads. | |
Re: DLLs and *nix shared libraries are completely different animials. [URL="http://www.cs.duke.edu/~ola/courses/programming/libraries.html"]Here is a link[/URL] that explains how to create shared libraries. I suppose DLLs and shared libraries could use the same source files for the functions that are in them. | |
Re: You need to write a MS-Windows GUI program, not a console program. [URL="http://winprog.org/tutorial/"]Here is an intro tutorial[/URL]. Note that the tutorial will not teach you everything, but just enough to get you started. There are several other ways to write Windows GUI, this is just the most basic. | |
Re: One way is to use threads. Another way is to use non-standard functions contained in conio.h -- but your compiler may or may not suppport them. | |
Re: call win32 api function [URL="http://msdn.microsoft.com/en-us/library/ms646312(VS.85).aspx"]SetFocus()[/URL] | |
Re: post one of the files that has the errors, especially the top of the *.cpp file where you have all the includes etc. The problem is most likely missing something like this: [code] #include <iostream> using std::cout; [/code] or this [code] #include <iostream> using namespace std; // Not recommended [/code] … | |
Re: [URL="http://www.google.com/#hl=en&q=x86+assembly+file+i%2Fo&aq=f&aqi=&aql=&oq=&gs_rfai=&fp=9cf8b09982c85f48"]Here [/URL]are some links that mey help you -- the first one even has source code. | |
Re: why are the members of birthday char* instead of int? But to answer your question [code] node1->bday.month = malloc(32); // allocate space for 32 characters strcpy(node1->bday.month,"January"); [/code] but if you mande them integers [code] node1->bday.month = 0; // January [/code] | |
Re: You can use ODBC function calls -- there are some online tutorials, just google for it. Or you can install and use MySQL++ which is a c++ wrapper for all MySQL functions. Again, google will point you to the download area. | |
Re: >>sizeof(ExtCordMainForm->TxDiagMessageRxEdit->Text)*2)+ The sizeof operator doesn't work on std::string objects because sizeof will return the size of the c++ class, not the string which it manages. You should use Text.size() or Text.length() to get the length of the string Next that line seems to be allocating enough space for wchar_t UNICODE … | |
Re: One of [URL="http://www.google.com/#hl=en&q=ssl+in+linux&aq=0&aqi=g1g-m4g-ms1g-m2&aql=&oq=ssl+in+lin&gs_rfai=&fp=9cf8b09982c85f48"]these links[/URL] may help you. | |
Re: cin.get() waits for you to enter a number followed by the return key. >>if(cin.get()>>1); That line makes no sense. If you look at the documentation you will see that get() returns an istream object so using the right shift operator on that return value makes as much sense as mud. … | |
Re: If you meet all the requirements of "who can apply" then I'd think you would already know the material or what to study. If you are smart enough to get a bachelor's degree in Entineering then you will probably be smart enough to pass the test. But since I have … | |
Re: If you only want to read the first line then take out that loop. | |
Re: Turn off precompiled headers. Go to the project settings, c++ tab and you will see a category for precompiled headers. | |
Re: >>when I tried to run it, it suddenly closed That's because there is nothing at the end of main() to prevent that behavior. If you want it to stay open so that you can see it, then add [icode]getche();[/icode] at the end of main(). The program will then stop until … | |
Re: What compiler are you using? Generally it is not a good idea to mix C and C++ code together in the same program. | |
Re: Agree with Nick and Ed. Optimatization isn't really important at all to beginners, they should be more concerned with just learning the language. Optimization will come later in a year or so. ![]() | |
Re: Microsoft compilers are all shipped with conio.h and associated library. | |
Re: It's "meet" people. "meat" is something you might eat such as a hamburger. | |
Re: Do you know SQL? If not then you will have to read an S[URL="http://www.google.com/#hl=en&source=hp&q=sql+tutorials+for+beginners&aq=1&aqi=g10&aql=&oq=sql+tutorial&gs_rfai=CBTb881gbTJjHB4rAM5SijMkFAAAAqgQFT9A3tLg&fp=9cf8b09982c85f48"]QL tutorial[/URL] There is no one-line C solution for your question. | |
Re: What GUI to use will depend on the operating system. For MS-Windows you have several options -- win32 api functions, wxWidgets, QT. Other compilers will also provide other options. | |
Re: Even if he had the PHP source code for that function it probably wouldn't do much good because it looks more like VB code than c or c++. >>having it in clean c++ would be useful in future... Of course you can write your own c++ function that simulates PHP's … | |
When I click the up or down arrow the thread gets an immediate vote even though a popup window has the option of cancelling it out (the x in the upper right corner). Would like to change the behavior so that nothing happens unless one of the two buttons at … | |
Re: How long has that been happening? Just recently or a very long time? Did you install something that may have affected the compiler's installation? Try reinstalling Visual Studio, uninstall it completely first so that it will reinstall fresh. Does kernel32.lib actually exist on the computer? [edit]Oh, I reread your post … | |
Re: 1. You must be compiling that program as c++, not C because C requires the keyword [b]struct[/b] before each use of the structure name, such as [icode]struct mystrut[/icode]. Change the file extension of the program file to *.c 2. >>(first+1)->number You can't access members like that because its a linked … | |
Re: Why is line 80 inside that if block? What good does it do? Line 80 declares an array of pointers which immediately goes out of scope and is destroyed. | |
Re: Ok -- here's the basic code [code] #include <stdio.h> int main(int argc, char* argv[]) { printf("Hello World\n"); } [/code] | |
Re: scanf() leaves the Enter key '\n' in the keyboard buffer, so the next time scanf() is called it will only see '\n'. One solution is to replace scanf() with fgets() which will remove '\n' if there is room in the input buffer. Something like this: [code] int main() { char … | |
Re: try running that system function on a line all by itself. | |
Re: what compiler and/or IDE are you using and what operating system ? How to link two or more *.c object files will depend on the compiler and/or IDE. | |
Re: Use mod % and division / operators. Since this is homework, sorry but I'm not going to say anything more about it until you post the code you have tried. | |
Re: The parameters are mapped in the order in which they appear in the argument list. The first parameter on line 11 (a) is mapped to the first parameter on line 3. The second parameter on line 11 (b) is mapped to the second parameter on line 3. That mapping can … | |
Re: I doubt that would be all that difficult -- sort of like picking a them for your windows computer desktop. The only thing I would make optional is the color selection -- fonts and other layouts would remain static as they are now. I personally don't like the purple, would … ![]() | |
Re: Use MS Access to put a password on it. Then you will have to change your program to use that password when opening the database. | |
Re: My GUESS is that your program contains bugs that went unnoticed or undetected under UNIX. Post the code. [edit]Nevermind -- glad you found the problem :) [/edit] | |
Re: Post the first couple errors so that we can help you decipher them. I can tell you right now that line 27 and 66 are wrong. Must be like this: [icode]void MovieDisplay(MovieData m1, MovieData m2)[/icode] But then even that does not satisfy the program requirements. You have to pass the … | |
Re: line 27: The argument to strlen() is a char* or const char*, not FILE*. FILE is not a character array. | |
Re: Compilers like to puke out a lot of errors for the same line. And an error on one line can spew out a lot of errors on other succeeding lines. So in practice I generally fix the error at the top of the list then recompile to get a new … | |
Re: clients ask information from servers, not the other way around. In your case your server is acting as the client, and the clinets are the servers. So you have one client with many servers. Or you could have the clients periodically push the information to the server intead of having … | |
Re: People are not here to write your programs for you or do your homework. Hence we say "do this" or "do that" instead of giving out actual code. The first thing you need to learn is how to use google and read MSDN. google for the function and you will … | |
Re: If you know how to pass the data to one function then there should not be a problem passing it to a million or more functions. The number of files (*.c or *.cpp) has nothing to do with it. | |
Re: The memory is not really lost "forever" -- most operating systems reclaim the memory when the program itself exits either normally or abnormally (crashes). When using current versions of MS-Windows or *nix it is not necessary to reboot the computer. | |
Re: [URL="http://lmgtfy.com/?q=multithreading+in+C%2B%2B"]And here too[/URL] | |
Re: line 1: its [b]int main()[/b] never ever [b]void[/b] main() line 7: feof is a function and it needs to be written as feof() line 9: why are you using cin to read from a file? cin gets information from the keyboard (YOU type the characters) not from the file. lines … | |
Re: >>Unfortunately, it is impossible to use a window proc on the console window I just tried SetWindowLong() to hook into the WinProc inside the os, but it doesn't work. According to MSDN [quote][b]Windows NT/2000/XP[/b]: You cannot change this attribute if the window does not belong to the same process as … | |
Re: I don't like it at the bottom either -- just makes it more difficult for new people to learn how to use DaniWeb. |
The End.