15,300 Posted Topics
Re: va_args will be of no help to you because all it does is point to the beginning byte of the stack where a variable of unknown size starts. The program still has to know the data type. This is how I impleneted a general-purpose linked list [code] typesed struct node … ![]() | |
Re: >>if (sign = '+') line 31 and others similar are using the assignment operator = instead of boolean ==. | |
Re: standard library time.h will do what you want. time() returns the current time in seconds since some pre-determined date (epoch), such as 1 Jan 1970. With that you can call localtime() or gmtime() to convert seconds into a structure that contains year, month, day, hour, and seconds. | |
Re: Don't worry -- everyone has that problem from time-to-time. It frequently takes a lot of time and studying to figure out how another programmer wrote a program. Been there, and done that. | |
Re: >>At one minute apiece, that's 180 man weeks It will not take near that long to do it in c or c++. Maybe one second or less for each file. Reading PDF, OCR and DOC files could take a little longer because their contents are a lot more complicated than … | |
Re: What have you tried so far? Have you used google to see if you can get any tutorials? Like [URL="http://www.codeproject.com/KB/database/msdatagrid.aspx"]this one[/URL]? And please, stop using those html tags, they don't work here. | |
Re: Binary searches only work on sorted data. So your first job is to sort the vector by energy. That should be fairly trivial if you use std::sort() and write your own comparison function. After that you could use any binary search algorithm on the vector, treating the vector as a … | |
Re: Assuming the computer has the language fonts installed, yes. You might have to write the program in UNICODE and use wfprintf(), which is the unicode version of printf(). | |
Re: You should never use gets() anyway because it could cause buffer overflow errors. Use fgets() instead. | |
Re: line 54 is opening the file in text mode, not binary mode. the open flag for binary mode is "rb". Same with lines 91 and 109. Opening the files in text mode on MS-Windows will result in incorrectly reading binary data due to the translation of CR/LF line terminating characters … | |
Re: declare another byte after the array. Get the address of arr and the address of that new byte, then subtract the two addresses. | |
Re: I vote for all of them because they all do a terrific job keeping out the spam and doing other moderator jobs that we normal people don't see. This poll is nothing more than a popularity contest, not one that tells who puts in the most effort doing mod duties. … | |
Re: look at the argument list for the function fun() -- it requires three parameters; two integers and a char*. Now look at how you are trying to call that function in main(). It is only passing one parameter instead of three. This compiles correctly with vc++ 2010 express. Note the … | |
Re: >>It means somebody is waiting for someone to reply. No it doesn't mean that at all. Many times the original poster will make a final post just to say "thanks" to all other posters, then leave without marking the thread solved. So IMO a new link for this purpose would … | |
Re: [quote]Raw input is available only when the application calls [URL="http://msdn.microsoft.com/en-us/library/ms645600(v=vs.85).aspx"]RegisterRawInputDevices[/URL] with valid device specifications[/quote] [URL="http://msdn.microsoft.com/en-us/library/ms645590(v=vs.85).aspx"]See this link[/URL] and read the Remarks at the bottom. | |
Re: maybe [URL="http://joysofprogramming.com/log4cpp-tutorial/"]this tutorial[/URL] will show you how to do it. | |
Re: See the links in my post in your other thread on the same subject (getting WM_INPUT message). [quote]Note that lParam has the handle to the RAWINPUT structure, not a pointer to it. To get the raw data, use the handle in the call to GetRawInputData.[/quote] [URL="http://msdn.microsoft.com/en-us/library/ms645590(v=vs.85).aspx"]link[/URL] | |
Re: I have not tried it but you might try something as simple as static global memory. MS-Windows does not support shared memory segments like *nix does, unless it may have been added by the .NET framework (I don't know about that). See [URL="http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/548f3d4b-ce7c-4164-a22c-f2e75c041761"]this link[/URL] and the links in it. | |
Re: >>can i get first the values from the yyyy, mm , dd columns, then name column, then phone and then email, and input them into a string? I don't know -- can you? I can, but I don't know if you can or not. (hint: read the line a word … | |
Re: [QUOTE=WaltP] And with his 5th point, to be honest, regular mail is just as bad - in reverse. My wife just got a letter addressed to her using her maiden name. We were married 16 years ago! Isn't it about time that name was removed from mailing lists? [/quote] I … ![]() | |
Re: You didn't say what operating system you are using. For MS-Windows, VC++ 2010 Express is my first choice, but for cross-platform I use Code::Blocks. If you are also interested in using the same IDE for other languages then Eclipse or NetBeans may be the best choice (although I have not … | |
Re: Some compilers may produce warnings if you declare main() with arguments and never use them. Use int main() if your program does not need command-line arguments, otherwise use the version with two arguments. | |
[URL="http://www.sodahead.com/united-states/should-delta-have-charged-returning-soldiers-a-3000-baggage-fee/question-1866569/"]This article from SodaHead[/URL] made me mad as hell. Delta airlines should be ashamed of itself for the outrageous act against returning service members. | |
Re: cin stops reading keyboard input at the first space or the enter key. The next time cin is called it will just take whatever is already in the keybord buffer, if anything. call getline() instead of cin to allow for spaces in the string. [icode]getline(cin,record[i].Sno);[/icode] | |
Re: 1. The null terminator is a character at the end of the string that contains '\0'. The example you posted could be rewritten like this: [icode]char phrase[13] = {'G','a','m','e',' ','O','v','e','r','!','!','!',','\0'}; Its just a lot more convenient for us to type it as in your example, and the compiler will generate … | |
Re: by encoding do you mean how to tell the difference between UNICODE and ascii text? [URL="http://linuxgazette.net/147/pfeiffer.html"]Here[/URL] is one link that may help you | |
Re: I never heard of the game crabs, but what is the question/problem with the code you posted? | |
Re: If you use two arrays, one for the scores and another for the names, during the sort you have to swap both arrays at the same time so that their order remains the same in both arrays. This is one reason why its much simpler to just use an array … | |
Re: or just hide the window [code] #include <windows.h> int main() { HWND hWnd = GetConsoleWindow(); ShowWindow(hWnd,SW_HIDE); } [/code] | |
Re: If you want to support any sql-compliant database then use ODBC, which is the oldest and most common way to access them. There are a few free c++ odbc wrapper classes, just use google and you will easily find them. Also you might want to read an odbc tutorial, which … | |
Re: A [URL="http://msdn.microsoft.com/en-us/library/ms221627.aspx"]VARIANT[/URL] is standard Microsoft structure used to pass object across COM objects. Use heavily in COM programming and to pass strings between VB and c/c++. The vt member of the VARIANT object tells what kind of object the VARIANT contains. Then the remainder of the structure is a union … | |
Re: There is no such thing as a good gui for MS-DOS Version 6.X or earlier. That's one reason Microsoft evolved into 32-bit protected mode programming and wrote MS-Windows operating system. MS-DOS simply doesn't support enough memory to allow for a GUI environment. About the best you can do is flip … | |
Re: @abh7i: You will want to do lots and lots of reasearch before you start to do anything. You can't hope to start any kind of company before you have the answers to the questions you posed. | |
Re: And you should know that none of those functions can be used with any modern 32-bit compiler. You need to use ancient compilers such as Turbo C or Turbo C++. | |
Re: Never use #include to include one *.cpp file in another. If you have two or more *.cpp files then they must be compiled separately and then linked together to create the final executable program. Your class declaration should be in header files (with *.h extension). You can put them all … | |
Re: You can't. templates take on a data type when they are declared. For example [icode]vector<int> list;[/icode] is a vector of integers. Once declared it can not be changed to a vector of strings or something else. But then again, maybe I misunderstood the question. Post an example of what you … | |
Re: what exactly do you want to do? | |
Re: [QUOTE=Azmah;1571188]What you are saying I hear alot. Give me a contradiction and I will investigate. Can you please give me verses that you find disturbing?[/QUOTE] [URL="http://www.infidels.org/library/modern/jim_meritt/bible-contradictions.html"]Biblical contradictions link here[/URL] But that doesn't mean the Bible is a fairy tail. It was written by many people over several centuries, so there … ![]() | |
Re: Too bad you didn't learn C before assembly. In any event, the purpose of the stack is quite simple -- its used to save register values, save return addresses, and to allocate memory for local variables. When the function returns to its caller the stack is reset back to where … | |
Re: [QUOTE=tikoti;1582575]Hi all! I've read forward declaration is much prefered than include in header files mainly because it reduces the compilation time. Other reasons? My particular situation is that all header files that I use are within a namespace. I've seen two different ways for forward declaration in this case: [CODE] … | |
Re: That is the wrong way to go about clearing the keyboard input buffer. Narue has written an excellent article about that very topic. See [URL="http://www.daniweb.com/software-development/cpp/threads/90228"]this link[/URL] | |
Re: Your compiler is correct. void main() is non-standard, the c and c++ standards require main() to return an int. Change your program to [icode]int main()[/icode] and it will be standards conforment. | |
Re: You could use any of them, but IMO Windows Forms (CLR/C++) or C# would be easiest to port that console program. If you want the program to be cross platform on both MS-Windows and *nix then wsWidgets might be better. | |
Re: just call rand() to generate random characters between 48 to 57 and 65 to 90 (see any ascii chart) | |
Re: Its illegal to write viruses -- you can go to prison for that. I would castrate without anastasia those who do that if I could get my hands on them. Me hostile?? No, not one bit. | |
Re: The function wants all of the strings, not just one of them. If you want to pass just a single string then you will have to change the signature of the function to getCatArrAndVals(char *s) | |
Re: 1. you should be reading a [URL="http://winprog.org/tutorial/"]tutorial[/URL] on win32 api functions. But anyway, [URL="http://www.functionx.com/win32/Lesson02b.htm"]here[/URL] is how cursors are created. 2. Probably uses [URL="http://msdn.microsoft.com/en-us/library/ms632589(v=vs.85).aspx"]windows hook[/URL]s to capture keyboard events. | |
Re: Has anyone actually read the assignment he posted??? It makes absolutely no sense. >>The user will input the sum of each row and each column. So the programmer creates a 3x3 array. How is the user supposed to know what the sum of the rows and columns are -- the … | |
Re: Huh? You'll have to be a lot more specific about what you want. Such as you have a library of functions written and assembles with masm that you want to call from Turbo C++?? |
The End.