15,300 Posted Topics
Re: > which has a ASCII value of 32 I think No. The character '0' has an ascii value of 48. C string null terminator 0 is an ascii value of 0. | |
Re: doesn't your book have questions at the end of chapters? Question: Easy: write a linked list of random integers that always keeps the data in sorted order. Harder: Same as above but add ability to add additional numbers, delete a node, or modify an existing node (might have to mode … ![]() | |
Re: [URL="http://www.amazon.com/gp/product/0131103628/sr=8-1/qid=1148814250/ref=pd_bbs_1/102-1008093-7201746?%5Fencoding=UTF8"]K&R[/URL] It's a book by the creaters of the C programming language | |
Re: VC++ defaults to using precompiled headers, which means that it will preprocess all the header files once and use that preprocessed file for all the \*.cpp files in the project. stdafx.h is the header file which contains all the other include files that are usd for this purpose. So the … | |
Re: > Please tell me if my code is correct Compile your program for DEBUG and you can find out for yourself if it is correct or not. assert() does nothing if the program is compiled for release. How to do that will depend on the compiler you are using. | |
Re: There is no \*nix version of conio.h. But I think you could accomplish the same if you used curses or ncurses library, or more low level yet if you use termcap library. [Here](http://forums.fedoraforum.org/showthread.php?t=56626) is a related link on Fedora.com | |
Re: The first element of all arrays is numbered 0, not 1. array arr has valid indices 0, 1, 2, 3, ... 20. The initial value of k should be 0, not 1. | |
Re: codeproject.com has a wealth of free windows code snippets, programs, and examples. If you are into windows programs then codeproject.com is a must-have bookmarked link. Although [this article](http://www.codeproject.com/Articles/113967/Check-It-Out-A-Simple-Win32-SDK-Checked-Listbox-an) is not exactly what you are looking for I think you will find your answer by downloading the demo program. If you … | |
If you have YouTube commercials you like, post them here. [ Here's on](http://www.youtube.com/watch?feature=endscreen&NR=1&v=6Z2WKFDWLn8)e that is really funny for Star Wars fans | |
Re: When that happens the file is either not where the program expects it to be, try adding the full path to the file name and see if that works. Or you misspelled the filename. \*nix file names are case sensitive, so you must make sure the name is exactly as … | |
Re: What do you people do to celebrate your independence day? | |
A 23 year-old man severly burned himself after igniting a firecracker in his butt cheeks ([link](http://www.huffingtonpost.com/2012/07/30/man-shoots-fireworks-buttocks-bottom-australia_n_1718842.html)). | |
Re: > induntation Do you mean ["indentation](http://en.wikipedia.org/wiki/Indentation)" ? | |
Re: > x['a']=0; Yes it can be done, but the array must be large enough for 'a' to be a valid index value. That may be useful when you need to count the frequency that each letter occurs in a sentence or other text document. You need to declar the array … | |
Re: line 18: should be text[i] != ' '. You used the wrong loop counter. After line 23 you should advance i counter until text[i] != space so that there can be more than one space between words line 15: gets() is a bad function to use becuse it will allow … | |
Re: What exactly do you want that if statement to do? | |
Re: Check the rest of your program to see if those functions are actually being called. | |
Re: you need to check the value of argc before using argv. argv[1] is valid only if argc > 1 line 28: you are attempting to copy argv[count+1] to a pointer that does not have any memory allocated to it. strncpy() does NOT allocate memory for the string, you have to … | |
Re: You must post the code you have tried to write, and/or ask questions. Just stating the requirement is not sufficient for us to help you. If you need to you can write it in your own language then run it through a translater before posting here. | |
Re: > displaytotal number notes of birr.100,50,10,5 and 1. Huh? Don't understand the problem. | |
Re: When you press Submit on the browser, the browser sends the data to your cgi program. [Here](http://www.yolinux.com/TUTORIALS/LinuxTutorialC++CGI.html) is an exmple of how it works, both the html script and c code. | |
Re: If you'r a mod, admin, or paid subscriber you can set your rank to say anything you want (within the bounds of DaniWeb rules of course) | |
Re: windows.h [SetTimer()](http://msdn.microsoft.com/en-us/library/windows/desktop/ms644906(v=vs.85).aspx). Your program must be Windows (WinMain instead of main) and have a message pump for that to work. If you just want a console program then you could create a thread and call [Sleep()](http://msdn.microsoft.com/en-us/library/windows/desktop/ms686298(v=vs.85).aspx) in a loop to put that thread to sleep then execute some code when … | |
Re: I don't get it -- how do you play that game? What do the numbers you put in pan1 and pan2 represent? Here is one of my inputs but I don't know whether its right or wrong because I don't understand the game. Enter number coins(max 12) : 12 Press … | |
![]() | Re: did you read [this wiki article](http://en.wikipedia.org/wiki/Segment_tree) or any of[ these google links](https://www.google.com/#hl=en&sclient=psy-ab&q=segment+tree+example&oq=segment+tre&gs_l=serp.1.1.0l4.18714.18714.0.20921.1.1.0.0.0.0.78.78.1.1.0.les%3B..0.0...1c.NEitk1RvW7s&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=5704db8c962dc0db&biw=1536&bih=764)? ![]() |
![]() | Re: you have to hover mouse over up arrow, add comments in box, then click up arrow. You can't click upp arrow first becuse the second time the rep will change from 1 to 0. ![]() |
Re: lines 86 and 89 are the problem. You need to use a counter that counts the number of times getline() is called so that you can put the data in the appropriate item of the arrzy. Start the counter at 0 and increment it at the end of that read … | |
Re: You need a compiler. What operating system are you using? If MS-Windows then download and install either Code::Blocks with MinGW or VC++ 2010 Express, both are free. If \*nix then you probably already have the compiler named gcc. But you need to tell us about your computer and operating system … | |
Re: Did you create a windows project then delete the WinMain() function that the IDE generated for you? You probably intended to create a console project, not a windows program. Windows program has WinMain() instead of main(). | |
Re: > char command[argc] You need to make that an array of pointers: char\* command[argc], then before copying the string from argv you will have to call malloc() to allocate memory for each string + 1 for the string's null terminator. line 8: The for statement is incorrect format. -- char* … | |
Re: You are just using the same font for all the edit boxes. If you want each one to have a different font then you need to create a font for each one. Make m_font an array and create separate fonts for each edit control. | |
Re: Have you tried [this?](http://lmgtfy.com/?q=how+to+create+a+dll+in+c%2B%2B) | |
Re: just H:\\\\\* (that's five \\ characters with no spaces) The 5th \\ is to escape the \* so that markup doesn't use \* for other purposes while editing. | |
Re: what compiler are you using? I know Visual Studio 6.0 had a bug that did that but it was fixed with one of its patches. Write another tiny program just to test if your compiler has a similar problem. | |
Re: what operating system? MS-Windows look for WinSock, \*nix look for Burkeley Sockets. There are lots of[ free online tutorials](https://www.google.com/#hl=en&sclient=psy-ab&q=c%2B%2B+socket+programming&oq=c%2B%2B+socket&gs_l=serp.1.1.0l4.4115.6359.0.9144.10.6.0.4.4.0.78.401.6.6.0...0.0...1c.TQJqBdOppmQ&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=808060ddfa2d2733&biw=1272&bih=725), even a couple youtube videos. | |
I want to post ' ' with 4 spaces between the tick marks, but the markup languages removes them. I tried inline code but that didn't help. How can I do that without using the Code button? | |
Re: Check [here](http://forums.codeblocks.org/index.php?action=search2) | |
Re: Here's what I get when I enter a player's name (you need to explain in the question that you are looking for a number), and flush the input stream if input is wrong. > re-enter them: You must enter numbers from 1 to 3, please re-enter them: You mus t … | |
Re: what kind of algorithms do you want? There are millions of them. | |
Re: what computer language -- e.g. c++, c, vb, java, assembly, cobol, fortran, etc. etc. | |
Re: You can gain as much memory as you want if you create DLLs. | |
Re: > i didn't even have a code to show you cause I know its wrong. That doesn't matter here -- most of the code we see posted here is wrong. All we require is that you make an effort to write your program, we don't require the code be correct. … | |
Re: > void main() main() ALWAYS returns an int, declaring it as void could result in undefined behavor, [read this thread](http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?id=1043284376&answer=1044841143) lines 16 and 17. Most C compilers and C standard before C99 require all variable declarations at the very beginning of a function or other scoped block marked with { … | |
Re: You probably need to use a merge-sort algorithm. Read the file in small chuncks, sort them, then write each chunk into its own file. When that is done you might wind up with 10-15 files, depending on the size of each chunck read. After that, open all the files at … | |
Re: virtual functions allow derived class to override functions in base class(s). When the base class calls a virtual function the top-most derived class function is called. If you have a base class called Animal and a derived class called Dog, when Animal calls virtual function Speak() the function in Dog … | |
Re: 1. The array must be in sorted order, you can either enter the numbers that way or call some sort of sort function after input. 2. Binary search assumes unique values, not duplicate values. The array can contain duplicates but binary search algorithm will find only one of them. 3. … | |
![]() | Re: use bubble sort algorithm (the easiest to code) and sort the list by number. When a swap is needed just swap the data within the node structure, not the nodes themselves. ![]() |
The End.