15,300 Posted Topics
Re: look in your compiler's limits.h header file. You will find them all there. >and anything bigger than that? That doesn't make any sense. What do you mean by "bigger than that"? >And also how to calculate this? How to calculate what? sizeof(object) returns the number of bytes required to store … | |
Re: Line 23: what exactly does sizeof(buf) return? Answer: check line 10 and you will see buf is declared as 1024 pointers, so sizeof(buf) is 1024 \* sizeof(char\*). Assuming sizeof(char\*) == 4 (which it does on MS-Windows and \*nix) sizeof(buf) = 1024 \* 4 = 4096. From briefly reading some of … | |
Re: [QUOTE=fzafarani;432095]Yes, I want to write my own C++ compiler [/QUOTE] Good luck :) Unless you have a Ph.D. in computer science and mathametics plan to spend the next 20 or so years writing it. | |
Re: You can easily skip the first line by calling fgets() to read it, then just don't use what was read. Do any of the strings contain spaces? fscanf with %s can't read the spaces. If there are no spaces with the strings then the fscanf line you posted will probably … | |
Re: run the ls command and redirect the output to a file or pipe. ![]() | |
Re: a+b adds the two ascii values. Look at [any ascii table](http://www.asciitable.com/) and you will see that 'a' == 97 and 'b' == 98, so a+b = 97+98 = 195. Now look again at that ascii table and find the character whose ascii value is 195. What you want to do … | |
Re: Other than poor formating, I don't see anything wrong with how you allocated the array. The values in the array are something else. void John_is_3D(int dimx, int dimy, int dimz) { int ***John; // pointer to pointer to pointer John = new int**[dimx]; // array of pointers to pointers for … | |
Re: [Here'](http://www.programmingsimplified.com/c/source-code/c-program-convert-decimal-to-binary)s one way to do it. | |
Re: To delete the inner list just iterate through the list and delete each node one at a time, something like this: It assumes head->item_data pointer is NOT NULL, so you should probably test for that before executing any of the code in this function. void DeleItemList(struct client* head) { struct … | |
Re: Do you have antivirus running on all PCs? Have you checked them for malware? | |
Re: line 5 is wrong -- notename[x] is a single character and c_str() returns a string. Maybe line 1 is incorrect -- `string notename[10];` which would mean notename is an array of string objects. string notename = "filename.txt"; x = 1; cout << notename << endl; if(remove(notename.c_str()) != 0) { perror( … | |
Re: I would be very surprised if you found any language translator that did the job 100% correct -- the .NET functions would be easy, but the rest nearly impossible due to differences in the two languages. | |
Re: create another class for those two then you can make an array of that class. See the examples posted in your other thread. | |
Re: If you have not yet studied structures then declare two arrays, one for 10 student names and the other for the sections. This assumes the names book1, book2, etc never change, so there's no point in storing those strings. If, however, those names can be different for each student then … | |
Re: what exactly is your question(s) about how to write that program. You will need to use functions srand() and rand() which generates the random numbers, then save the values in an array. Each time a new random number is generated search the array to see if it's already there. If … | |
Re: What event is supposed to cause the program to run? If the program only needs to run once or twice a day then use the operating system to schedule it as G_Waddell suggested 2 days ago. | |
Re: The file will do no good without the server. The target computer must have the server software or the server must be on a computer that the target computer can access, such as both computers on the same network. | |
Re: Function AddClient() doesn't return anything. Either make it return something or make it a void function. Try this, where I've remove redundent code. Try this version, where I removed redundent code. void AddItemToClient(struct client *head, char item_name[30], char item_state[30], double price, char status[30], double price_if_not, int day, int month, int … | |
Re: You can also do it with [_stat()](http://msdn.microsoft.com/en-us/library/14h5k7ff.aspx) | |
Re: >Will the while loop get confused by multiple NULL characters No, it will stop when it encounters the first NULL character, all others are ignored. >will fscanf be able to overwrite the NULL character each time Maybe, it will try to store as many characters as it can in the … | |
Re: >Is there any reason I should rename it to eulerTwo? You can, but it's not necessary. There is nothing wrong with using numbers in function names -- it's actually pretty commen. | |
Re: I've noticed similar problems quite often, so I got into the habbit of refreshing the page after pressing the "Submit your Reply" button. If I don't sometimers the edit I just made disappears. Refreshing the page seems to solve the problem. | |
Re: The only time I have found recursion useful is when transversing the file system, such as in [this](http://www.daniweb.com/software-development/cpp/code/216812/searching-linux-directories) code snippet. Otherwise I try to avoid it, mainly because many years ago recursion was just too expensive in terms of memory and time. I know those aren't as critical any more … | |
Re: @Gensk: You didn't say what operating system you are uing. The sugestion by deceptkion works only on MS-Windows. If you are using \*nix then you will have to do something else. | |
Re: Its not the compiler but the touch screen device driver. Is this for a PC or wireless? touch screens on a PC are all different so you will have to read the manufacturer's programming documentation to find out how to interface with it. Its been about 10 years since I … | |
Re: what is inarray()? You have too much duplicate code in that function. This is the recommended way to write such functions, not that it does not call feof() at all, but relies on fgets to return NULL then end-of-file is reached. else { while(fgets(word1, 30, fileIn) != NULL) { //succeeding … | |
Re: You need to post the structure. Is left and right pointers to ITEMTREE structures? > but proposed code notice failure You need to be more specific about the erors. compiler errors? If so, what are they? Runtime errors? What is the behavior of the program? | |
Re: Were those two structures given to you or can you make them up yourself? There are two linked lists -- Client and within each client node is a Items linked list. To add a new client node you have to search the Client linked list to see if it is … | |
Re: No order the this list Ink Masters Tatto Coverup Judge Judy Law and Order SUV Top Gear (UK version) Dr Who Star Trek (all of them) American Ninja Warrior Big Love (HBO series) | |
![]() | Re: >@mike so simply by using static in every function we mean that we want this variable to be related to the function only No -- variables declared within a function are never visible to other functions, and they are auto destroyed as soon as the function returns to it's caller. … |
Re: That's a microsoft compiler thing -- it supressed warning number 4996, which is a warning about deprecated functions. Just delete that line if you use another compiler. > how can we cout the locations What do you mean by "locatins"? The vowel's position within the string? Such as there is … | |
Re: Yes, but only if you help yourself out. Please post the code you have attempted then we can answer questions you might have. ![]() | |
Where did you hide the Indorsement button? I can't find it anywhere. Nevermind -- I figured it out. There used to be a button in the purple ribbon, but I guess you got rid of it probably because it was consuming too much realestate. The list of people to endorse … ![]() | |
Re: Is there always just one number on a line, or can a line have more than one number? If only one number, then just count the number of lines in the file. | |
Re: r/1200 is doing integer math which means all decimals are discarded. So 10/100 is 0 because 10 cannot be divided by 100. You can fix that in one of three ways (1) Declare r as float instead of int, then use scanf("%f") instead of scanf("%d") (2) Typecast either the numerator … | |
Re: maximum is the size of the screen and its resolution, usually 25 x 80. The 35X25 was common when PCs first came out in the early 1980s. But MS-Windows console screens have much smaller fonts and more rows. | |
Re: For numbers you have to do a little more processing -- convert the ascii value of the char to binary then add it to an integer. This works for English language and standard ascii character set. I have no idea what you intend to do with the number, but whatever … | |
| |
Re: First you have to create a project, that will generae a default \*.cpp file. You can put your class there or add a \*.h file to the project. You might want to read Getting Started page [here](http://msdn.microsoft.com/en-us/library/dd492171.aspx). | |
Re: c++ is used for a great deal more than web development. Most PC games and desktop apps are written in c++. c++ can also be used as CGI programs (google "CGI programming") | |
Re: There are many kinds of databases: simple text files, binary files, and numerous SQL compliant databases such as MySQL (free). Which kind do you want to create? | |
Re: I was going to test using Visual Studio 2014 to see how the results compared with yours. But VS won't even compile it due to this line `task_type tasks[total_sum / min_coin + 1]; // <- use VLA` | |
Re: I wouldn't want such a pill -- think about it, I wouldn't get Social Security for another 900 or so years! | |
![]() | Re: Christmas has an [interesting history](http://www.history.com/topics/christmas). It was not a holiday in early America, and in fact was outlawed in Boston for a few years. Christmas didn't become a federal holiday in America until 1870. I anticipate one day in the not-too-distant future Congress will pass a law abolishing it as … |
Re: (1) Use your compiler's debugger so that you can step through the execution of the program and see where it stops. (2) or scatter some print statements around. | |
Re: UDP is not recommended for long distances because there is no guarentee that the packets will ever arrive. TCP is best for that. |
The End.