15,300 Posted Topics
Re: you have to add some openGL libraries. Look in openGL docs for one of those functions and it should tell you what libraries you have to use. | |
Re: Are you using the example code from[ here?](http://support.microsoft.com/kb/238393) | |
Re: its customary to name the top of the tree (node 1) "head" struct tree* head = NULL; After allocating a new tree node check of head == NULL, if it does then just set head = newnode. | |
Re: You need to include <string> header file. Also, change <stdlib.h> to <cstdlib> | |
Re: Compilers are not required to honor the inline keyword, so the first example is guarenteed to be the fastest. The other two examples may or may not be the same timing, depending on the compiler. | |
Re: Just because the build succeedes doesn't mean the program works correctly. Use your compiler's debugger to find out where the problem is. The problem is line 84 -- I found it in less than 1 minute with the debugger. [edit]I see you edited your post to correct that problem after … | |
Re: You could get [this one](http://www.forecastpro.com/products/overview/FPSDK.htm). Or you could write the program yourself if you know how to forcast inventories. google might be the first place to start learning how its done. | |
Re: >And it wouldn't be the first time that a noob incorrectly posted a C++ question in the C forum would it? I've done it by mistake several times. | |
Re: >no wait...its not wrong...we are just using different Compilers. Yes it is wrong, the C and C++ standards dictate that main() always returns an int, that's the standard way all compilers do it. If your compiler deviates from that then you are likely to encounter problems if you use another … | |
Re: What you posted will work only inside that function. As soon as the function exits the grid will be destroyed. You can resolve that by passing a pointer to the grid to the function, something like this: void displayBoard(char board[][10]) { // code goes here } int main() { char … | |
Re: >I am having TurboC installed in my system Why? Sounds like that old ancient compiler is not compatible with modern computers and modern graphics cards. If you want to use that compiler then try to find yourself a 30-year-old computer, one that was made in the 1980s or 1990s. | |
I can't edit the code I posted in [this thread](http://www.daniweb.com/software-development/cpp/threads/432459/c-variable-in-sqlite-query#post1854736) because it won't let me place the cursor where I need to add something. I put the somewhere then use the arrow keys to move it to the right spot but it just goes to random locations. I want to … | |
I don't like it. When I start a new thread I get a popup asking if I want to share it on Facebook etc. Looks cute the first time, but it will get very annoying after that. | |
Re: You have to set the string before calling salite3_prepare(). std::string select; std::string username = "AncientDragon"; select = "SELECT * FROM grammateas WHERE username = '" + username.c_str() + "'"; sqlite3_prepare_v2(handler,select.c_str(), -1, &statement, 0); | |
Re: The results make sense -- vectors have a lot of overhead that take cpu cycles, more time than just doing the calculations. The program has to make other calculations just to access the vector item. | |
Re: Since all the cells have different values the only way to do it is in a loop, incrementing the cell values one at a time. Are they all incrementing values like you posted? I suspect they are not because if they were then you would not need the array. | |
Re: You can easily do it yourself. Just look up those hex numbers in any [ascii chart](http://www.ascii-code.com/) | |
Re: The reason cores is modified each time a line is read is because cores is a pointer to the file input buffer str1. Change core to just a single char instead of a pointer so that it will not depend on the contents of str1. The condition on line 25 … | |
Re: (5/9) is doing integer division, not floating point division, which means that all fractions are lost, so the result of that is 0. To correct that problem add a decimal point, e.g. (5.0/9.0) or (5.0/9) or (5/9.0). As long as numerator or denominator or both are floating point numbers it … | |
Re: 15 years ago I chain smoked, the room I worked in was always filled with my smoke. Then one day the boss banned smoking from the workplace, so I would take frequent breaks to smoke outside, regardless of weather. I smoked in my house also, until one day we had … | |
Re: You need to call [SysAllocStringByLen](http://msdn.microsoft.com/en-us/library/windows/desktop/ms221637(v=vs.85).aspx) because the strings are char\* instead of wchar_t\* | |
Re: The same reason I asked the same question awhile back, you have to hit the Refresh button on your browser. Its a javascript quirk. | |
Re: Go shopping, play Diablo III game, or visit DaniWeb. Occasionally I'll drive to one of the near-by tourist attractions for the day. | |
Re: build failed because you didn't write code for function disp_student_classhonour() (or you didn't post it) | |
Re: you need to keep two different pointers for curr because you have two different loops. Try this: [code] curr1 = head; while(curr1) { strcpy(check,curr1->word); curr2 = curr1->next; while(curr2) { if(strcmp(check,curr2->word)==0) printf("duplicate"); {here should come the remove node function} curr2 = curr2->next; } cur1 = cur1->next; } [/code] | |
Re: >But could anyone please help me with how to convert these char arrays into integer arrays. No conversion is necessary, characers are nothing more than small one-byte integers with a range of values -127 to 126 or unsigned 0 to 255. You simply treat then as if they were int … | |
Re: delete lines 14 and 26, the continhue statement is not needed | |
Re: A quick glance at the code indicates whoever wrote it didn't know what he/she was doing. For example lines 28-35 are writing beyond the boundries of the array. Line 25 declares undefined return value for main() -- the only legal value is int, never void. I'm not going to bother … | |
Re: The ++ operator doesn't know the difference, the compiler determines the difference based on where the ++ operator is used, such as ++i or i++. And in some cases it won't matter whether its post or prefix. The code inside the operator function should not care one way or the … | |
![]() | Re: I don't know if this is the "most efficient" way, but one way to do it is to have an array of integers, then fill the array with numbers as they are read from the file. When you find a number that appears a second time delete it from the … |
Re: It might be easier to use fscanf() rather than fgets() float dollars = 0.0F; int nAnimals, nRacks; fscanf(in,"%f", &dollars); fscanf(in,"%d%d", &nAnimals,nRacks); // etc etc As for the rest of the problem, I'd first sit down with and figure it all out by hand with pencil & paper so that you … | |
Re: line 10 is impossible because merge_sort() does not take that many parameters. The number of parameters on line 10 have to match exactly the parameters on line 1. You can give them different variable names, but the number and type of parameters must be the same. The value of mid … | |
Re: what compiler are you using? Try debugging it (single-step through the program until you find the line that produces the error). Many good IDEs will have debuggers that let you do that. Check for uninitialized pointers. | |
Re: I call mktime(). One crevet -- you need to initialize all fields of struct tm to 0 before using it becuse mktime() will return an error of any of the fields contain random junk values. Here's an easy/quick way to do that. struct tm tm; memset(&tm,0,sizeof(struct tm)); | |
Re: [use assert(](http://www.cplusplus.com/reference/clibrary/cassert/assert/)) instead of TRACE. Or create a console project that supports MFC. | |
Re: It might also depend on which operating system the wav file was originally written with -- such as [Big or Little Endian](http://en.wikipedia.org/wiki/Endianness) | |
Re: Check out some of [these Microsoft links](https://www.google.com/#hl=en&sclient=psy-ab&q=visual+c%2B%2B+2010+walkthrough&oq=vc%2B%2B+2010+walk&gs_l=hp.1.0.0i22.74.6794.1.9089.10.8.1.1.1.0.78.507.8.8.0.les%3B..0.0...1c.AzIWY1QwKxo&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=1150f400ff4f823e&biw=1590&bih=870). As they say, practice makes perfect, so you should plan to spend a lot of time creating projects, exploring the various options available in the IDE, and learning to use the excellent debugging facilities. And don't forget that you can always ask questions … | |
Re: 1) system("pause") is not portable -- only works on MS-Windows and MS-DOS operating systems. 2) cin.get() is a lot faster [URL="http://www.gidnetwork.com/b-61.html"]Other reasons[/URL] | |
Re: >>i saw this code in a particular book..... what an awful algorithm to put in a book! I thought books were supposed to teach the language not how to obfuscate it. I think you should trash-can that book and get a different one. | |
Re: you don't need that second loop for(int i = 0; i < 3; i++) cout << a[i] << '\n'; | |
Re: It will probably find little green people with long antennas saying ["nano nano"](http://www.google.com/imgres?imgurl=http://the60sofficialsite.com/images/antenna%2520-%2520My%2520Favorite%2520Martian.jpg&imgrefurl=http://the60sofficialsite.com/My_Favorite_Martian.html&h=320&w=306&sz=16&tbnid=p753SYLOKXV6TM:&tbnh=90&tbnw=86&zoom=1&usg=__DrQL8wsTE1QyU_mmzClLi9XlJ_Y=&docid=iRaNQgbol66UEM&hl=en&sa=X&ei=bWMuUKyDDcbaywHszoCwBg&sqi=2&ved=0CGYQ9QEwBA&dur=606) | |
Re: [QUOTE=Salem;1098444]...when you can remember having to use an ACTUAL [URL="http://en.wikipedia.org/wiki/Rotary_dial"]dial [/URL]to dial a telephone number.[/QUOTE] Or a crank telephone Or remember watching [URL="http://www.youtube.com/watch?v=va5Btg4kkUE"]this presidential campaign ad on tv[/URL] | |
Re: you could compress them with a program like WinZip then require a password before de-compressing them. | |
Re: > i need to download a good compiler, what can you recommend me? Download free VC++ 2010 Express or newer -- vc++ 2012 will be released when Windows 8 is released, but you can get prerelease version now for free. You might also try Code::Blocks with MinGW. Dev-C++ doesn't work … | |
Re: Do you mean the edit control? If you need to edit a label control then just change its Text property. | |
I just noticed the text in the Related Article link now includes a lot of information that could be useful to prevent prople from resurrecting old threads. Is that something new you have added receitly? Whether its new or not I like it. :) | |
Re: Where have you searched? Have you studied the information in [this link](http://issc.uj.ac.za/symbolic/symbolic.html)? | |
Re: go to a command prompt and try that command. BTW your program works ok on Windows 7 using vc++ 2012. What compiler and operating system are you using? |
The End.