82 Posted Topics
Re: [code]$rands = range(1,40); shuffle($rands); for ($i=0; $i<$numeroDeobjetos; $i++) { $usada[$rands[$i]] = true; }[/code] | |
Re: Line 56. [code]int d = rhs.denominator[/code] This misses an ending semicolon. [i]Line 47:[/i] When adding two variables of the type [b]Rational[/b] like: [code]f1 + f2;[/code] What happens function-call wise is: [code]f1.operator+(f2);[/code] so [b]Rational rhs[/b] is the [b]Rational[/b] that is added to the [b]Rational[/b] with which we start. | |
Re: Because the [b]\[/b] is the character used to escape things like quotes, it's not appropriate to use it on its own. Use [code]std::cout << " \\ ";[/code] instead. | |
Re: [code]bool playAgain = true; cin >> playAgain; while( (playAgain == 'Y' || playAgain == 'y' ));[/code] Enough of a hint? :) | |
Re: [code]output.open("TEMPS.DAT", ios::in);[/code] [code]output << temp[counter1] << endl;[/code] Do not make sense as you are trying to [b]write[/b] to an [b]in-stream[/b]. This should be what you're looking for: [code]output >> temp[counter1];[/code] | |
Re: You can't include array variables in double-quote strings like that, this has to be done either of two ways: [code]// Connect to the database $dbc = mysqli_connect("localhost", "xxxxxxx", "xxxxxxxxx", "xxxxxxx"); $data = "SELECT ID FROM user_registration WHERE username = '" .$_SESSION['username']. "'"; $query = mysql_query($data) or die("Couldn't execute query. ". … | |
Re: Yes the line numbering is correct so the question is, why did you put a [b]-->[/b] at the end of line 36? (And also 37, 38, 39) Maybe you were trying to comment out those lines? Note that what you've placed are only HTML comments and since PHP executes before … | |
Re: If you look at this page [url]http://www.cplusplus.com/reference/algorithm/find/[/url] you'll see that [b]find()[/b] requires the [b]== operator[/b] to be defined on your class, and it's not. Something like this probably: [code]bool A :: operator ==(const A &t) const { return ((x == t.x) && (strcmp(name, t.name) == 0)); }[/code] On a side … | |
Re: The first attempt doesn't work because if it WOULD work, you could never write the word IPADDRESS in a string without having it replaced by it's definition. What might work but of which I'm not sure is using {IPADDRESS} instead of just IPADDRESS. And in the second attempt you didn't … | |
Re: [QUOTE=floatingDivs;1549222]DeIntegro, The reason you're only getting one row is because you're querying for one row. You need to query an array of rows. [code] $row = mysql_fetch_[b]row[/b]($result); [/code] should be [code] $row = mysql_fetch_[b]array[/b]($result); [/code][/QUOTE] This is not true. Both functions fetch one row from the query and store it … | |
Re: The easiest way to see if the derivative changes sign when considering time derivatives would of course be to see if the difference between the last and 2nd to last Z changes sign. This would mean something like [b]if((deltaZ[lcv] - deltaZ[lcv - 1]) * (deltaZ[lcv - 1] - deltaZ[lcv - … | |
Re: Obvious question: do you have a mail server running? | |
Re: Quote from cpp reference: 'Allocates a block of size bytes of memory, returning a pointer to the beginning of the block. The content of the newly allocated block of memory is not initialized, remaining with indeterminate values.' | |
Re: [QUOTE=makman99;1542345][code]$result = str_replace ("--","-",$string);[/code] Should remove all if there's 3 in a row: --- It would find the first two [--]- and replace with one: [-]- leaving -- which is then replaced by -[/QUOTE] Neither has the desired behaviour. str_replace doesn't rescan already replaced input and so --- will be … | |
Re: You've misplaced the parenthesis in this line: [code] if(strcmp($line,$name == 0)) {[/code] Should of course be: [code] if(strcmp($line,$name) == 0) {[/code] | |
Re: Do you mean that this effect has to happen in real time or are you trying to 'render' the images with GD? Because if you're aiming for real time, GD wouldn't be my tool of choice since you'd have to use for instance AJAX to get every next image from … | |
Hello there forum, After a pretty thorough C++ course I've tried my hands at coding an actual project but have stumbled on a pretty big problem and here I am asking for your help. What I'm trying to make right now is a class which communicates with a gameserver through … | |
Re: You're missing an ending double-quote here. [code]$servicesoffered="<br/>"."$edit_servicearea_str<br/>\n$detailedmsg<br/>;[/code] | |
Re: [CODE]<option value="cashout">Refinance-Cashout</option>[/CODE] [CODE]$buysell=="Refinance - Cashout"[/CODE] That doesn't match. Should be [CODE]$buysell=="cashout"[/CODE] | |
Re: Is reversing the vector an option? I guess this should work: [code]reverse(foo.begin(), foo.end()); long some_long = *(long *)&foo[0];[/code] | |
Re: That's because an array is nothing but a pointer to the start of a memory block, so [code]cout << array << endl;[/code] will print the memory address of the start of your array. To print the whole array you should iterate over the 'rows' (first index) and print each array … | |
Re: [QUOTE]I am a 22 year old college gal[/QUOTE] I see what you did there.. :P This is the short solution I came up with, but I wouldn't know if it's valid for your exercise. [code]#include <iostream> using namespace std; int posInteger(int sum){ int number, revSum = 0; cout << "Enter … | |
Re: What rubberman said is actually wrong. In a multiset an element's key is itself so you need to specify only one type. Now I'll try to explain to you why you get this error: When you use a function that's defined from a template, your compiler will at compile-time create … | |
Re: This simply means that the [b]$var[/b] you're trying to split doesn't contain any [b]|[/b] at all, therefore the resulting array ([b]$tmp[/b]) is only 1 element long and [b]$tmp[1][/b] doesn't exist. | |
Re: The [b]dereference (*)[/b] operator has lower priority than the [b]member (.)[/b] operator so you need to add brackets: [code=C++](*str).length()[/code] | |
Re: [B]strpbrk[/B] effectively returns the part of the string starting at the first occurence until the end of the string. If you pass such a string to [b]atoi[/b] it will return the first numeral and ignore everything after that. Note that this numeral doesn't have to be 1 digit long but … | |
Re: If in your while loop you know which one is the one you want to display add 'selected' to the <option> like so: [code=html]<option value="..." selected>[/code] For which you can use the short if-else: [code=php]<option value="..."<?php echo ($selected) ? " selected" : ""; ?>>[/code] | |
Re: Maybe you can post a little more about the structure of your table, maybe some sample data? I can't really visualize what you're trying to accomplish right now. | |
Re: [url]http://php.net/manual/en/function.header.php[/url] This lets you change the HTTP headers which is probably the best way to redirect someone. Something like: [CODE=php]Header("Location: /$directory");[/CODE] Be sure to put it early in your document, before any output is generated, or you will get an error because you can't change the headers anymore. | |
Re: Maybe this? [CODE=c++]testPF(std::move(a), std::move(b))[/CODE] |
The End.