15,300 Posted Topics

Member Avatar for Grovespaz

>>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 …

Member Avatar for Grovespaz
0
69
Member Avatar for Ancient Dragon

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, …

Member Avatar for Ancient Dragon
2
318
Member Avatar for Phil++

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.

Member Avatar for Ancient Dragon
0
96
Member Avatar for justice igwe

>>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.

Member Avatar for Ancient Dragon
-5
357
Member Avatar for nathanurag

[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.

Member Avatar for Ancient Dragon
0
151
Member Avatar for dkanthi

[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 …

Member Avatar for drekha
0
468
Member Avatar for Soileau

>>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 = …

Member Avatar for gerard4143
0
138
Member Avatar for chaienbungbu

>>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 …

Member Avatar for chaienbungbu
0
180
Member Avatar for nagajyothi

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 …

Member Avatar for Ancient Dragon
0
141
Member Avatar for Aamit

@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.

Member Avatar for Ancient Dragon
0
3K
Member Avatar for adcodingmaster

>> 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 …

Member Avatar for Ancient Dragon
-2
108
Member Avatar for cpp_noobsauce

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 …

Member Avatar for Salem
0
240
Member Avatar for pradeey

>>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 …

Member Avatar for Rajesh R Subram
0
139
Member Avatar for nichya88
Member Avatar for nichya88
0
139
Member Avatar for robinotje

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]

Member Avatar for robinotje
0
194
Member Avatar for aszopinski

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]

Member Avatar for Rajesh R Subram
0
184
Member Avatar for Siberian

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.

Member Avatar for Ancient Dragon
-6
256
Member Avatar for DavidDD

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 …

Member Avatar for DavidDD
0
350
Member Avatar for techniskull

[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

Member Avatar for Ancient Dragon
-1
79
Member Avatar for leeba

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].

Member Avatar for leeba
0
675
Member Avatar for merse

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.

Member Avatar for Dave Sinkula
0
100
Member Avatar for nayef

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.

Member Avatar for jonsca
0
141
Member Avatar for sree_ec

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.

Member Avatar for Ancient Dragon
0
143
Member Avatar for sidra 100
Member Avatar for whitebread

Read [URL="http://support.microsoft.com/kb/187912"]this article [/URL]about how to pass strings between VB and c++

Member Avatar for whitebread
0
210
Member Avatar for jiapei100

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.

Member Avatar for Will Gresham
-4
93
Member Avatar for sidra 100

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]

Member Avatar for Agni
0
78
Member Avatar for lio180

>>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 …

Member Avatar for printrobin
0
114
Member Avatar for neoeinstein

[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. …

Member Avatar for neoeinstein
4
683
Member Avatar for Stefano Mtangoo
Member Avatar for atticusr5

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 …

Member Avatar for Ancient Dragon
0
102
Member Avatar for ContactaCall

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]

Member Avatar for Ancient Dragon
0
1K
Member Avatar for makan007

>>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.

Member Avatar for Ancient Dragon
0
435
Member Avatar for zzjason

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. …

Member Avatar for Ancient Dragon
-3
125
Member Avatar for cwarn23

@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 …

Member Avatar for Stefano Mtangoo
0
424
Member Avatar for Dave Sinkula

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 …

Member Avatar for ablitz
4
349
Member Avatar for khess

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 …

Member Avatar for SpiralBlue
2
1K
Member Avatar for Xeros606

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 …

Member Avatar for abdelhakeem
0
136
Member Avatar for bhushnxx

[QUOTE=WaltP;1103417]Somebody forgot to read the Forum Rules as requested multiple times upon signing up.[/QUOTE] Naw -- he just simply ignored them.

Member Avatar for Ancient Dragon
-5
133
Member Avatar for jakesee

didn't you [URL="http://wiki.linuxquestions.org/wiki/OpenGL"]read this[/URL]. It was the second google link hit

Member Avatar for jakesee
0
202
Member Avatar for thekashyap

>>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 ???

Member Avatar for jbennet
0
135
Member Avatar for Ancient Dragon

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 …

Member Avatar for jbennet
0
134
Member Avatar for llamaboy

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, …

Member Avatar for llamaboy
0
121
Member Avatar for King Dede

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 …

Member Avatar for Stefano Mtangoo
0
325
Member Avatar for samarudge
Member Avatar for Ancient Dragon

[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 :)

Member Avatar for WaltP
1
325
Member Avatar for joejoe55

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.

Member Avatar for Nick Evan
0
104
Member Avatar for zhouxuzhu1985

why are you trying to load a Microsoft DLL? The os will do it when your program starts.

Member Avatar for zhouxuzhu1985
0
117
Member Avatar for athlon32

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 …

Member Avatar for Ancient Dragon
0
90
Member Avatar for CJesusSaves

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.

Member Avatar for CJesusSaves
0
157

The End.