15,300 Posted Topics
Re: I've seen it done both ways -- and even seen people mix them. Myself, I prefer listing methods first. | |
Re: You start by not using a dead language like Delphi. Then spend about 5 years or so learning how to write games with a real language such as C or C++. | |
Re: [quote]The invested interests spend so much national wealth in preparing the Olympic Games to blandish the international, launch so much propaganda about the 2008 Olympics to gloss over official corruption and social inequality![/quote] That could have been said of every nation in the world that hosts an olympics. Boycotting an … | |
Re: [URL="http://www.daniweb.com/forums/announcement8-2.html"]Homework[/URL] ? | |
Re: That function compiles ok for me using VC++ 2005 Express. Maybe you forgot the include files <string> and/or <vector> ? | |
Re: Imposible for anyone to help you without more information. Please post your code. Do you get errors when you compile the program or when you run the program ? | |
![]() | Re: [QUOTE=St!tch;432629]I'm starting out...obviously, a newbie here. However, I cannot understand that when I run this code with the first number being 34 and my second number being 40 ....I get the output of 39. This is not my homework. I'm just trying to learn on my own for now. Thanks … |
Re: What you need is an array of 10 integers to contain the count of each interval. For example a[0] is the number of random numbers that fall between 1 and 5, a[1] = 6-10, etc. After generating a random number at line 15 use a series of [b]if[/b] statements to … | |
Re: >>an option would be to use run-time polymorphism. I thought about that too but dismissed it because it may not work. [b]createandmanipulate()[/b] still has to know whether to allocate an object of type Class1 or Class2 before returning. If it allocates an object of only [b]base[/b] then the caller will … | |
Re: Its not very clear what you did and what you want. Do you mean you created a structure and saved their contents to a file, now you want to search the file for a specific record ? If that is correct, then read the file sequentially from beginning to end, … | |
Re: what language are you writing the assembler in ? C language ? What have you already done to find the information you are seeking ? As for me, I never had the occasion to write an assembler, so probably can't help you much. | |
Re: [URL="http://www.winprog.org/tutorial/"]Another excellent tutorial[/URL]. Its not necessary to use c++ to write win32 api programs and the tutorial in my link doesn't require c++. | |
Re: I would use a structure to hold the information for each bowler, then after entering the information sort the array of structures by score. After that print the array information. [code] struct bowler { std::string bowlername; int score; int points; }; [/code] | |
Re: first, that function needs to know the size of each matrix -- don't leave any dimensions unspecified as you did. Your function appears to be derived from the bubble sort -- toss it in the bit bin because it will not work. A transpose function does not need a temp … | |
Re: simple solution -- move lines 28 and 42 up to line 7 so that its scope is to the entire function. Also you can't declare a matrix using non-static number of elements. If you don't know the size of the matrix at compile time then you have to allocate the … | |
Re: ms-windows call GetFirstFile() and GetNextFile(), or in *nix call opendir() and readdir(). If you used c++ you can use boost library that is portable between these two operating systems (I don't know a thing about MAC). ![]() | |
Re: The function new returns a pointer to the end of the memory block, not the beginning. I think it would work if written like this: [code] void * operator new( unsigned int iSize ) { static unsigned char aMemPool[10000]; static unsigned iUsed = 0; if( iSize == 0 || (iUsed+iSize) … | |
Re: when BUILD_RELEASE is defined the Debug macro is not evaluated and the function on line 11 of the code you posted will only be executed if a == 0, in otherwords line 11 becomes part of the [b]if[/b] condition on line 9, just as if it were written like this: … | |
Re: There isn't a [b]tutorial[/b] but there is some information to help you, such as [URL="http://www.google.com/search?hl=en&q=how+to+convert+c+program+to+unicode&btnG=Search"]these google links[/URL] | |
Re: Its really sluggish this evening (9:43 PM CST) and was pretty bad early this morning too (6:00 AM CST). Using IE7 on Vista Home. | |
Re: [QUOTE=GrimJack;430939]Actually there is a way to automate it completely. I found the site ([url]http://www.nliteos.com/)[/url]. [/QUOTE] someone must have removec the link from that site because its no good any more. :'( | |
Re: maybe [URL="http://www.cplusplus.com/doc/tutorial/operators.html"]this[/URL] will help :?: | |
Re: practice, practice and more practice. write a simple game, such as hangman or tick-tack-toe. The concepts will become more firmly set in your mind with more coding. | |
Re: Although you didn't attach the list it is obvious that the error message means you are now linking to the wrong libraries. You need unicode version of the libraries from wherever you got the non-unicode libs. | |
Re: you should probably use a switch statement instead of a series of if statements, unless your assignment requires if statements. Move the last statement (lines 50-54) to the beginning so that its tested first, then put else statements before each if statement, like you did on line 50. ![]() | |
Re: why not just do it the quick and easy way, assuming the binary file is no larger than the char buffer. If the size is unknown than we'd have to first find out the file size and allocate the buffer appropriately. In any case it will be a lot faster … | |
Re: America is pretty low on the list for health care -- [URL="http://www.photius.com/rankings/healthranks.html"]37th on WHO's list[/URL] with France #1. Mortality: again America is in the 24th on [URL="http://www.photius.com/rankings/healthy_life_table2.html"]the list of countries[/URL]. | |
Re: >> write a better implementation of this function. You do it, we don't have the time. Of course if you would pay me $5,000.00 I will do it for you :) | |
Re: Isn't it somewhere in the book of Revelations (Bible) that indicates we are in our final days when people are required to have a number tattooed on the forehead? I'm sure you said that in jest, but then .... | |
Re: If the code you posted contains errors then nothing will happen because the compiler will not generate an executable program. The ocmpiler generates the final executable program only when you have fixed all errors. | |
Re: initial values: a = 2 and c = 1 First iteration: a = (2 + 2) * 1 = 4 Second iteration: a = (4 + 4) * 1 = 8 Third iteration: a = (8 + 8) * 1 = 16 Fourth iteration: a = (16 + 16) * … | |
Re: what has the code you posted to do with the two questions you asked ? My guess: absolutely nothing. Please read board rules -- especiall the part about [URL="http://www.daniweb.com/forums/announcement8-2.html"]We only give homework help to those who show effort [/URL] | |
Re: no one is going to write the program or you, so you might as well read your text book and learn how to do it. Tables usually are two dimensional, with rows and columns and look something like below (I'm certain you have seen this before in hundreds of places) … | |
Re: [URL="http://www.daniweb.com/code/coder46588.html"]Here[/URL] are workable examples of getting all the files in a directory and all its sub-directories. | |
Re: Yes, if you don't give printf() the correct arguments then its behavior is undefined. But most likely it will assum the stack contains the correct arguments and use whatever is there. That's why a lot of people get core dumps or access violations then they have "%s" in the format … | |
Re: There are a few free C++ classes that might be useful to do the database part especially if you plan to use something like an SQL server, MS Access, Orical or something similar. Access via C and C++ can be quite compilicated so its advisable to use a C++ class … | |
Re: >>I'm surprised even compiles Depends on the compiler. Some compilers check the first argument to see if any other arguments are needed and give warnings for mismatches. Other compilers don't care. | |
Re: read [URL="http://www.google.com/search?hl=en&q=c+program+to+read+excel+file&btnG=Google+Search"]this[/URL] and [URL="http://chicago.sourceforge.net/devel/docs/excel/"]this[/URL] | |
Re: [QUOTE=iamthwee;428472]What is a segway?[/QUOTE] Didn't you look at the picture in that link ?:D | |
Re: you can have as many [b]-I[/b] flags as you want -- just put a space between then on that CFLAGS line | |
Re: you created a windows program not a console program. The simplest fix to that problem is to start all over again, but this time when you get to the [b]Application Settings[/b] window choose [b]Console Application[/b] [edit] what WolfPack wrote -- I didn't see it when I wrote this [/edit] About … | |
Re: [b]Odometer[/b] is the name of the class, not of an object. | |
Re: [QUOTE=TkTkorrovi;418901]Ohh, mistake in the title, can someone repair it? [/QUOTE] Fixed -- but next time you should use the [b]Flag Bad Post[/b] button to make such a request easy for one of the mods to see. | |
Re: you need to truncate the string at the spot where you want to stop printing. If you want the full string later then save that character in another variable and put it back after printing [code=c] char c[40], *pc, save; int size; scanf("%s", c); size = strlen(c); save = c[size-4]; … | |
Re: [QUOTE=rainbringer;427982]O.K., thanks! I'm downloading it now, although it took time to find a link to it. It's well hidden from some reason. I hope it's full enough. Thanks again![/QUOTE] Please post link:) | |
Re: c++ classes and their methods are not callable from C. | |
Re: Or turn off UNICODE Project --> Properties -->Configuration Properties, then the value of [b]Character Set[/b] property to [b]Not Set[/b] | |
Re: [QUOTE=ehsen;427884][code] system("pause"); [/code] system(pause) is the best method.[/QUOTE] Your response is just a tad bit late -- by almost two years! :-O |
The End.