15,300 Posted Topics
Re: >>My reasoning is, I have to replace the relative jump with an absolute jump, to the address of my own function. Bad idea. Why? Because the address in memory will change every time the program is loaded by the operating system. Therefore you will never know the address of your … | |
The idea for this came from another thread in the C++ forum that wanted to duplicate the _getdelim() function that is supported by GNU compilers g++. I made one major change in that this version does not allocate new memory every time it is called, which is grossly inefficient. Instead, … | |
Re: GUI depends on the operating system. You can use os-independent classes such as wxWidgets or QT that work on both MS-Windows and *nix. Maybe works on MAC too, I don't know. >>Are they hard to implement and use? Yes. | |
Re: >>this code will unblock the command prompt of any system that has been disabled. Not likely! If the operating system is disabled (locket up -- stalled -- crashed) then how is your batch file going to run? The only way to unblock such a system is to reboot the computer. | |
Re: [QUOTE=nathanurag;1110054]hi is there any way by which we can write a program that displays its own source code???????:?::-/[/QUOTE] Of course, just open the *.c file, read each line and print it on the screen. | |
Re: [QUOTE=dkanthi;1109692]I hav run the code specified in the link. It is showing error as "ssize_t is an undeclared identifier" what content shouls v write in "getdelim.h" header file?[/QUOTE] It is misspelled it -- it should be [b]size_t[/b] I just tried to compile that with VC++ 2008 Express and found out … | |
Re: >>case 0: state = "Alabama"; You need to pass state as a pointer to a pointer, and statenumber should probably be an integer instead of char. [code] void writestate(int statenumber, char** state) { switch(statenumber) { case 0: *state = "Alabama"; break; <snip> } } int main() { char* state = … | |
Re: >>CRectangle * d = new CRectangle[2]; That is just allocating an array of 2 CRectangle objects. It could have been written like then: [icode]CRectangle d[2];[/icode]. But if it did that then it could not replace the 2 with something else at runtime. >>d -> set_values(5,6); That is the same thing … | |
Re: That will only work on MS-Windows if you use MinGW compiler -- I know of no other compiler that has that non-standard C function. fgets() will work almost like getline() but there is no equivalent to getdelim(). Too bad they aren't standard C functions because they both seem to be … | |
Re: @Saba: The code you posted is pretty bad. It uses void main() instead of int main(), uses depreciated header files (c++ no longer uses .h extension in its standard headers), and mixes C and C++ strings, and adds absolutely NOTHING to the thread that has not already been said. | |
Re: >> Y we use DLL files? Answer: Y not? >>where we should use DLL files and where not DLLs are never actually required -- the same thing could be accomplished by using statically-linked libraries. But then that would make the operating system and all the programs on it very very … | |
Re: line 9: If you want someone to type up to 20 characers then you have to define [b]charString[/b] as 21 in order to allow room for the null string terminating character. line 23: All you want here is to enter a single character, not an entire string. Similar to line … | |
Re: >>what actually makes the first one [( ie) use of pointers in classes] advantageous rather the second one ?? Nothing. The two examples you posted the first one (ignoring the error in the code) is actually less advantagous, not more advantagous because the pointer is unnecessary because there is a … | |
Re: do you mean [icode]&say[i][/icode]? in the loop at the bottom of the program? | |
Re: the \ character is a special character in c/c++ and has to be escaped, meaning you need two of them [icode]remove ("c:\\users\\asus\\new.docx");[/icode] | |
Re: You need to turn off UNICODE. Go to menu Project --> Properties (last item in the menu), Configuration Properties --> General. Then change "Character Set" (3d from bottom on the right) to "Not Set". Either that or use UNICODE string literals, such as [icode]_TEXT("Some string literal")[/icode] | |
Re: Will you all donate $30,000.00 USD to me so that I can buy a new Toyota Prius?? Just deposit all your money in my PayPal account. Its nice, shiny new car that will give me lots of pleasure to drive. | |
Re: getline() will return the entire line up to the '\n' character. That is not what you want. And the loop is wrong. [code] while( myfile >> words[a] ) a++; [/code] [edit]Well, the above is incorrect too because you are storing the words in a vector. Vectors do not auto expand … | |
Re: [URL="http://mathforum.org/dr.math/faq/faq.calendar.html"]Here[/URL] and [URL="http://www.daniweb.com/forums/thread106469.html"]here[/URL] are a couple links you might want to read | |
Re: The operating system populates argv[0] -- you don't have to do anything. When you type an argument on the command line it becomes argv[1], not argv[0]. | |
Re: Instead of [icode]const double& error = 0[/icode] you could code it as [icode]const double* error = NULL[/icode]. References can not be NULL, but pointers can. | |
Re: If you are taking a C course you should already have a textbook and notes from class lectures. C programming is not a course that you can study in one evening and expect to get a passing grade. It requires a tremendous amount of time and effort. | |
Re: strstr() is not a function that would be useful for this purpose. I would use strtok() to split the string into individual words, put each word in an array of char pointers, then print the array backwards from highest to lowest array indices. | |
Re: Read [URL="http://support.microsoft.com/kb/187912"]this article [/URL]about how to pass strings between VB and c++ | |
Re: There was some talk awhile back about disabling signatures for new posters in order to reduce signature spammers. Apparently Dani has implemented that because all the older posters here have signatures. | |
Re: what are the error messages? >>cout <<"add"<<addBills(expense m1); The parameters should not contain the dta type, just variable names, such as [icode]cout <<"add"<<addBills(m1);[/icode] | |
Re: >>this is the question and i want functions for the highlighted. Well, you're not going to get it here. You will have to write the function yourself. How to sort the names will depend on how you have the names stored in memory. There are lots of sort algorithms, but … | |
Re: [list=1] [*]Don't clear the screen because there may be information on the screen that people want to see. But you could use something like [icode]system("cls")[/icode] or write your own cls() function using os api calls. [*]namespace is just an umbrella used to keep symbol names from colliding with each other. … | |
Re: There is no such class or structure named wxNoteBook. | |
Re: I really really HATE two things about your code style: (1) CAPITALIZING FUNCTION NAMES, and (2) typedef'ing standard c++ class names. All that accomplishes is making your program more difficult to read and understand. You should be coding for clarity, not attempting to impress your teacher or others with an … | |
Re: My guess is that VALUES strings must be surrounded with single-tick quotes (unshifted double quotes on my keyboard). [icode]sprintf(cmd, "INSERT INTO prueba VALUES('%s')", Name); [/icode] | |
Re: >>Qns: 1st task: Can advise whether my code is ok? Compile and run it to find out for yourself. But I faile to see how that's useful to your stated problem. The problem you posted does not ask you to write numbers to the output file. | |
Re: You will want to use[URL="http://msdn.microsoft.com/en-us/library/kdzttdcb%28VS.80%29.aspx"] _beginthreadex[/URL]() to create the two threads. Scroll down to the bottom of that link and it will show you an example of how to create the thread and wait for the thread to exit. After the thread ends call [URL="http://msdn.microsoft.com/en-us/library/ms683190%28VS.85%29.aspx"]GetExitCodeThread[/URL]() to get its return value. … | |
Re: @crarn: IMO your best solution would be to use Code::Blocks/MinGW on both MS-Windows and Ubantu. I like Microsoft compilers a lot too, but it isn't cross-platform to *nix. OpenGL would be the engine you need, not DirectX. It seems to me that you need to be more open minded and … | |
Re: I don't see any reason to have an icode button -- what's so difficult about just typing them in as you type? I don't use the code tag button either for the same reason. I can just type the tags by the time I have to remove my hands from … | |
Re: Both Fedora 11 and Ubuntu work with all the hardware I have -- HP Officejet 6500 All in one printer, 1.5TB USB HD, HP Pavilion m8530f computer, flat-screen monitor, Logitech wireless keyboard/mouse. The problem I found was lack of support for 65-bit operating systems. Example: Abode does not have 64-bit … | |
Re: 1) Depends on how quickly you learn. When I started I had nothing more than a book and an old Radio Shack computer with *nix-like os. I learned enough in about a month to get my first programming intro job with Account Temps (temporary employment agency). But that was mid … | |
Re: [QUOTE=WaltP;1103417]Somebody forgot to read the Forum Rules as requested multiple times upon signing up.[/QUOTE] Naw -- he just simply ignored them. | |
Re: didn't you [URL="http://wiki.linuxquestions.org/wiki/OpenGL"]read this[/URL]. It was the second google link hit | |
Re: >>I searched but couldn't find any threads on the topic.. why would Dani want to create a forum for something that will not be used ??? | |
It seems like some people are not out of the woods yet -- [URL="http://www.merlyn.demon.co.uk/critdate.htm#CDs"]here [/URL]are some critical dates (from twitter) [quote] # 2010-01-01 Fri - Y2.01K. There will be some who have coded only for Years 200# # 2010-01-01 Fri - Sorting YYMMDD decade-reversed covers 1990-2009 only # 2010-01-01 Fri … | |
Re: which function do you mean? If you mean lines 6-10 then the those functions must be declared to return something, such as [icode]int function()[/icode] or [icode]void something()[/icode]. Default return values are not permitted in c++. line 153: that should be () at the end because its calling a function. However, … | |
Re: I prefer VC++ 2008 Express (or any other edition) because of its superior debugging tools. I have yet to see another non-Microsoft IDE that matches the debugging features and ease of use that VC++ 2008 has. The remaining features of that IDE are more eyewash than anything else and have … | |
Re: I've been using that for quite some time. | |
[URL="http://www.stltoday.com/forums/viewtopic.php?t=689541&postdays=0&postorder=asc&&start=0"]An interesting and mind-boggling thread[/URL]. When God created the universe 6,000 years ago He made it look like the universe was 16 billion years old. Yea, right :) | |
Re: Is GetPlayerX() and GetOldPlayerX() two methods of the same c++ class? If yes then you could just store the position as a member of that class. If not then use a global (ugg!) variable. | |
Re: why are you trying to load a Microsoft DLL? The os will do it when your program starts. | |
Re: The template was not working when the value of the item to be added is less than the value of the first item in the list. I corrected it like this: [code] template<typename T> void sortlist<typename T>::add(typename T dataToAdd) { // if list is empty if(bottom == NULL) { bottom … | |
Re: Read through [URL="http://msdn.microsoft.com/en-us/library/aa716527%28VS.60%29.aspx"]Microsoft's Scribble Tutorial [/URL]-- it is something similar to MS-Paint and it serializes the data. See how that tutorial serializes data and it might give you some ideas how to implement it in your program. |
The End.