1,358 Posted Topics
Re: It's barely been 10-mins. You can't expect immediate answers. [URL="http://www.daniweb.com/forums/thread279441.html"]Especially when you triple post.[/URL] Good Luck. | |
Re: This probably should be a new thread, but... Your linker either can't find the file or the file is damaged. Did you copy the file "appio.lib" to your program's "release" folder? Are you sure you entered the path to the file correctly? If the file is damaged, you'll have to … | |
Re: After the input on Line 49 there is still a newline character ('\n') that is lingering in the input stream. When you get to the next input (on Line 80), an invalid input type is detected which causes your input stream to get corrupted. You need to extract this before … | |
Re: Does it stop once i=12 or after it displays the 12? Your statement isn't very clear... If it shows the 12 then stops, that is normal behavior for the for loop as you have written it. This is why mitrmkar suggested you use const values for your array sizes. That … | |
Re: [URL="http://www.daniweb.com/forums/announcement8-3.html"]*kicks ass*[/URL] You should have started this long ago. | |
Re: You can not compare more than 1 value in a particular comparison statement. You use the logical operators to combine multiple comparisons to produce a net result. [U]not legal:[/U] [INDENT]if (aValue == 1 || 2) if (1 < aValue < 4)[/INDENT] [U]legal:[/U] [INDENT]if (aValue == 1 || aValue == 2) … | |
Re: [URL="http://www.w3schools.com/ajax/default.asp"]AJAX. Have the button activate a JavaScript function that connects to PHP to access the database.[/URL] | |
Re: [URL="http://www.daniweb.com/forums/announcement118-2.html"]You obviously either don't know what rules are or don't know how to read.[/URL] Even if I did know how to help you, I'd be inclined not to. | |
Re: You have 2 options: 1. Sort the array, then search. If done properly, the numbers you're looking for will be directly adjacent to the target. 2. Use 2 double tests to check if a value falls within an ever-changing range of values. [CODE]if (nextLow < input && input < target) … | |
Re: "It doesn't work" isn't going to cut it. Give us some specifics. Also, [use code tags](http://www.daniweb.com/forums/announcement8-3.html) | |
Re: [QUOTE]Can anyone tell me what I am doing wrong, I am trying to use the push_back function thanks.[/QUOTE] Not without seeing the relevant portion of your code... | |
Re: Even though you technically can, NEVER call main(), it is not intended to be a recursive function. A loop, specifically a while loop in this case, is the correct way to do it. The issue is that his conditional is not written correctly, as WaltP pointed out. | |
Re: [QUOTE](gameBoard[rows][cols] == [rows-1][cols+1] )[/QUOTE] Not real sure what you are trying to accomplish here. I think you probably meant [iCODE](gameBoard[rows][cols] == gameBoard[rows-1][cols+1] )[/iCODE]. You have this same basic error for every comparison in your fiveInArow::diagonalRightWin() function. At first glance, I'm pretty sure you've replicated it in your other "Win" functions … | |
Re: It will depend on 1. how you created the vector<Object *> and 2. how and when you created the individual <Object>s. 1. Is foo dynamically allocated, or did you create a vector<Object *>, then assign the vector's reference to foo? If foo was not dynamically allocated, I don't believe delete … | |
Re: When you are passing an array, you only use the name of the array, you do not use the braces. If you use braces, the compiler thinks you are trying to pass a specific element. This causes 2 errors: 1. you haven't identified the specific element you want 2. you … | |
Re: Look at Lines 45 and 49. What's missing...? Hint: You have 4 function calls crammed into 2 lines. You need to add 4 pairs of 2 characters. Also, line 45 isn't doing what you think it is. You should reconsider the operators you are using there. While you're at it, … | |
Re: Perform a query. As you loop through the return append each return record to the array. That should be all it takes. Although, from a design standpoint, I'm not too sure this is a good idea. It has the potential to be a HUGE security risk. If a malicious user … ![]() | |
Re: To pass an array, you must specify your parameter as an array. [CODE]void aFunction(int anArray[][dim2Size]); //prototype void aFunction(int anArray[][dim2Size]) { //function header for (int dim1 = 0; dim1 < dim1Size; ++dim1) { for (int dim2 = 0; dim2 < dim2Size; ++dim2) { printf("Value in anArray[%d][%d] = %d \n", dim1, dim2, … | |
Re: It's exactly the same logic as finding the max. You basically just start with a "high" value (rather than a "low" value) and reverse your comparison. Store the first element of the array directly to the "min" variable, don't bother with min=0 because that can skew your results. Once you … | |
Re: [QUOTE=moods125;1196824] <snip> here is my code...i have some errors and cant seem to fix them...can someone help me[/QUOTE] That doesn't give us much to go on. You want specific, targeted help, give us specific, targeted information.... I'm [B]guessing[/B] your errors are related to the way you set up truck's inheritance … | |
Re: It is legal, as long as the expression evaluates to a value within the acceptable range of indexes. The range of i is zero (0) thru (rows^2)-1. When you multiply i by rows, you dramatically increase its value to a point where it is outside the limits of the vector. … | |
Re: Dev-C++ comes with the MinGW compiler, but it's probably an old version. The Code::Blocks version is most likely newer. You'll have to mark the thread "solved" yourself. There should be a "mark as solved" button at the bottom of the listing, next to the "Reply to this Thread" button. | |
Re: This thread is almost 5-years old. Considering the OP's post count, they've probably long since moved on. Just look at [URL="http://www.daniweb.com/forums/post127235.html#post127235"]typek's links[/URL] and be done with it. If they don't help, start a new thread. | |
Re: This isn't a snippet, it's a homework assignment. How do you think DeleteRecord() should work? | |
Re: It looks good conceptually, but I'm a little concerned about the structure of that for loop. It overruns the boundaries of the original array. I think you should probably use the first for loop to copy the data, then use a second for loop to finish initializing the rest of … | |
Re: Well, I'm not sure about how all the stuff you have crammed into that line works, but I do know that you are trying to call setdepend() with only 1 argument and it requires 2. What did you forget to send to it? [edit] wait... nvm.... You have 2 functions … | |
Re: You really can't output in that format directly without a lot of DOM commands. (Don't ask me about them, I won't be able to help.) What you may want to do is find a sensible way to temporarily store the data within your script as you read it from the … | |
Re: [QUOTE]Holding.h:[B]15[/B]: warning: `class Holding' has virtual functions but non-virtual destructor In file included from p6.cpp:[B]12[/B]: Recording.h:[B]13[/B]: warning: `class Book::Recording' has virtual functions but non-virtual destructor p6.cpp:[B]90[/B]: error: expected `}' at end of input Book.h:[B]14[/B]: warning: `class Book' has virtual functions but non-virtual destructor[/QUOTE] The numbers that I have bolded are … | |
Re: [I suggest you read up on code-tags, rinku.](http://www.daniweb.com/forums/announcement8-3.html) | |
Re: [CODE] ifstream in_stream2; // reads pricelist.txt in_stream2.open(" PRICELIST.txt",ios::in);[/CODE] Do those filenames match? Nope..... You have an extra 'space' at the beginning of the filename and you have it in all caps. Delete the space and convert the name to lowercase. [CODE]ifstream in_stream4;// read recipt.txt in_stream4.open("proff.txt", ios::in);[/CODE] These names don't match … | |
Re: You have been around long enough, you should know how code tags work. I suggest you fix your tag while you still can. MrJNV already covered your name read issue. The space in the grades line shouldn't be an issue. In fact, it's beneficial. All you have to do is … | |
Re: Get rid of the shifts, you don't need them since you are using a bit field and are assigning directly to the various bits. Then, change your current assignments: [CODE]complete_buff->buf1=(unsigned char)0x01;; complete_buff->buf2=(unsigned char)0X00; complete_buff->buff3=(unsigned char)0x01; complete_buff->buff4=(unsigned char)0x01; complete_buff->buff5=(unsigned char)0x00; complete_buff->buff6=(unsigned char)0x00; complete_buff->buff7=(unsigned char)0x00; complete_buff->buff8=(unsigned char)0x00;[/CODE] To this: [CODE]complete_buff.buf1=(unsigned char)0x01;; complete_buff.buf2=(unsigned … | |
Re: Try using "endl" instead of '\n'. Also, consider getting rid of the "g" variable, all it really does is take up memory and require extra steps. [CODE]int main() { ofstream myfile("report.txt"); int billy [] = {16, 2, 77, 40, 12071}; for (int n=0 ; n<5 ; n++ ) { myfile … | |
Re: You would have to read them in to properly position the read pointer for the next read. Once they are read, simply ignore them and move on to the next read. To put the values in an array, put the read process in a loop and use an index variable … | |
![]() | Re: Either you have a multiple inclusion, or you duplicated your declaration statement somewhere, or your function call isn't formatted correctly. You'll have to post more of your code to tell though, there's just not enough here. |
Re: In addition to the syntax error mentioned by mitrmkar, your posted code and your posted output do not match. Which one is correct? I have Win 7 Pro (32-bit) and I use cin all the time with no issues at all (outside the normal lingering characters issue inherrent in the … | |
Re: [QUOTE=firstPerson;1193787]what you are looking for are more along the lines of this : [code] void populateUniqueRandom(int Array[], const int size, int start, int end){ assert(end-start == size); //make sure the size the correct size for(int i = 0; i < size; ++i){ Array[i] = end - start + i; } … | |
Re: Your call appears to be formatted incorrectly, but I can't tell if that's the only issue. [URL="http://www.daniweb.com/forums/announcement8-3.html"]I suggest you read this first.[/URL] [URL="http://www.gidnetwork.com/b-38.html"]As well as this.[/URL] [edit] oops..... a mod (Nick Evan) beat me to it.... | |
Re: The extra char is probably the null terminator. Have your loop check for '\0' and terminate without processing when it's detected. | |
Re: Not real sure what a "Projection" operator is, but your "Selection" operators are the "dot" and "arrow" operators ('.' and '->' respectively). They are used to access the elements of an object. An example class: [CODE] class example { public: example(int newInt = 0) : aPublicInt(newInt) {} //default constructor int … | |
Re: [QUOTE=dualdigger;1190468]My problem is not random no generation rather I need to select 30 random records from query table out of 300 records. At the moment, if my player selects 30 questions options, he gets only the first 30 questions from collection of 300 records, I want this selection to be … | |
Re: [First, read the announcement about code tags](http://www.daniweb.com/forums/announcement8-3.html) [Second, read this functions tutorial](http://www.cplusplus.com/doc/tutorial/functions/) [Third, read this classes tutorial (closely)](http://www.cplusplus.com/doc/tutorial/classes/) Finally, add the proper return types to your member method implementations in the echoit.cpp file. | |
Re: > start quote: #include (iostream.hpp) class Stocks { public: Stocks( int price); ~Stocks(); int get_price() const {return pps;} int set_price() const {pps;} int the_price_is (int pps); int pps; } int main() { Stocks AMX (35) cout << " Hello, please enter a symbol.\n"; if cin>> AMX; cin.ignore; cin.get; AMX.the_price_is cout<<" … | |
Re: How would you write it in C++? Pseudocode is very freeform, just describe how you would do it in C++. Just don't make it the formal C++ syntax. | |
Re: Approach what exactly? You just barfed out a bunch of code (that's probably not even yours) and yelled "HELP!" [URL="http://www.daniweb.com/forums/thread78223.html"]Have you read any of the posting guidelines?[/URL] We have absolutely no information to even begin to know how to help. [URL="http://www.daniweb.com/forums/announcement8-2.html"]Is this homework? Have you thought about it at all?[/URL] … | |
Re: [CODE]int arrayLength = 0; int time[arrayLength]; [/CODE] Is that even legal? Can you have a zero-length array? I know some compilers are starting to allow the use of a non-const variable to determine an array's size, but mine doesn't. When I try to compile your original code, other than the … | |
Re: http://www.daniweb.com/forums/announcement8-3.html You've been around long enough to know how to use code tags. Don't count on much help until you use them properly. | |
Re: It is possible, but there is not enough info here. How are you generating the URL? What are these values for? Where in the URL did you want to put them? [URL="http://www.daniweb.com/forums/announcement8-2.html"]Most importantly, what have you tried so far?[/URL] | |
Re: LOL, [URL="http://www.daniweb.com/forums/announcement8-2.html"]"givemetehcodez" type posts don't fly around here.[/URL] | |
Re: I don't think you can force input to be a digit. Look up the [URL="http://www.cplusplus.com/reference/iostream/ios/good/"]good()[/URL] and [URL="http://www.cplusplus.com/reference/iostream/istream/ignore/"]ignore()[/URL] stream member functions. Then, once you are familiar with them, modify your validation loop. |
The End.