244 Posted Topics
Re: This may work. [CODE]for(i=0;i<DetectedFaces.size();i++) { temp.push_back(DetectFaces[i]); }[/CODE] | |
Re: very limited knowledge of this but this using ctime appears to give a rough time the code took to run. [CODE]double time=clock(); //program cout<<clock()-time<<" ms"; or cout<<(clock()-time)/1000<<" seconds.";[/CODE] | |
Re: try google for isupper toupper etc. never mind beat to the punch. | |
Re: [CODE]#includes <iostream>; [/CODE] maybe [CODE]#include <iostream>[/CODE] would work better. | |
Re: @FutureWebDev There are 210 ways to choose 4 from 10 but there are 24 permutations of each therefor 5040 is correct. @MarounMaroun How is your 2D-array (of size [1260][4]) going to hold 5040 combinations? | |
Re: as has been previously stated [CODE]int array[10][/CODE] contains 10 elements indexed from 0 to 9 if you attempt to read array[10] who knows what you will get. | |
Re: This is not overly difficult but as jonsca said have a go first. | |
Re: first off how would the game work on say a 4x4 board? how would a diagonal win work?(is it still 3 in a row or is it the full length of the board) if its the former its closer to a connect 4 game. if its the latter then again … | |
| |
![]() | Re: Would a loop where you take mod 10 then divide by ten work? i.e [CODE]while(num>0) {//some code to add to the stack num%10 num/=10;}[/CODE] ![]() |
Re: where's the recursion? p.s is this a euler question? | |
Hey there. I'm trying to figure out how to subtract one array of integers from another. I have figured out how to add 2 together going digit by digit and carrying over. I have no idea how to go about subtracting one from another. Basically i want to do simple … | |
Re: search the many other threads here related to your problem. | |
Can anyone tell me how to find the maximum value for a specific variable(i.e int, long long int, double)? Also is there a way to set a variable to this value(without knowing it and typing it in)? Using Dev C++. Any help appreciated.:) | |
Re: i don't get the for loop | |
Can anyone tell me if it is possible to set a value in an array to infinity and if so how to go about it? Thanks. | |
Re: can't say for the recursive version but for the iterative one you could put an if statement in the loop to see if the MAX value(for data type) divided by the next term to be multiplied is less than your running total then this would overflow the range of your … | |
Hey, i know this is a commonly asked question (and will probably get burned for asking it again) but wanted an up to date answer so here we go. I'm trying to learn to program in c++ purely as a hobby. I have recently spent some time doing problems at … | |
Re: Don't think i can help as this is more advanced than i can manage but i would recommend that you actually ask a question or state a problem giving details of what it is you need help with. (you may get more replies this way) Good luck.:) | |
hi again, i'm just full of problems. i have a vectors of ints and i am trying to find a way to check if there is a repeatting sequence within the vector and what size this sequence is. Does anyone have any suggestions on how i should go about this? … | |
Re: don't really get your code as i'm a total noob but [CODE] if ( ( npx - opx !== 2 && -2 || npy - opy !== 1 && -1 ) && (npx-opx !== 1 && -1 || npy-opy !== 2 && -2) )[/CODE] should these !== not be just … | |
in my code i have declared [CODE]typedef signed long long int slong; const slong limit=4000000; const slong limitsqr=2000;[/CODE] i then created an array [CODE]slong* array=new slong[limit];[/CODE] without any problem. when i try this [CODE]slong* newarray=new slong[limitsqr][limitsqr];[/CODE] i get the error message: in function int main() cannot convert slong(*)[2000] to slong … | |
Hi, new to this so go easy. I'm trying to store a function i wrote in a file and call it with a header file rather than copy and paste as ive been doing but i keep getting error messages from the compiler. Can anyone point out what i'm doing … | |
How do i create a large array in c++? Apologies if this has been answered already but after searching didn't find what i was looking for. i want to create an integer array of size 1500000 i.e int array[1500000] but my compiler wont allow it. I remember seeing something about … | |
Re: if u want i could just post you the code save you the work | |
Re: then you will have to learn or you will fail(rightly so). no help will be given to you to trick your professor | |
Re: i dont really understand what you are attempting. could u be more specific? | |
Sorry if this is repetative but still struggling with this. i wish to multiply 2 long integers together. if the result is outside of int64 range i want the loop to break otherwise i want to keep the result and increment the second number. have tested this, but when the … | |
Re: most basic code for this problem(not the best,can be done with pencil & paper )is for(i=1;i<1000;i++){ if(i%3==0||i%5==0){count++;}} many better ways than this p.s. am currently running a program for project euler(will take days) so i can access the forum for the problem and see how the clever people did it. … | |
Re: what in particular do u want to return for example if the input is "f"? | |
Re: as a newbie myself take my advice with a pinch of salt why have three functions that all do the same thing why not have just one and call it three times? secondly i find recursion a nightmare to get my head round so where a simple while loop would … | |
Re: Is this a joke? Can you do it for me i can't be bothered? | |
when i try to use pow with cmath header i get error message pow(int,int)is ambiguous it also gives other possible options i.e pow(double,int) why is int^int ambiguous? how could it be less ambiguous? | |
hi, beginner question i am planning to write code for different values of a^b. both a and b will vary in the program and both will be long long ints; as my compiler wont allow pow(int,int) as it is ambiguous(dont know why) either while have a as a double and … | |
trying to write a fuction to work out the GCD of two numbers seems to run ok but the return is incorrect any help much appreciated #include <iostream> #include <cmath> using namespace std; int g_c_d(int a,int b); int main() { cout<<g_c_d(2871,4060);/*test example*/ cout<<endl; system("pause");/*been advised not to use this but … | |
Re: or sum+=number probably just being a bit silly | |
Re: line 9 should read for(index=0; index < strlen(pointer); index++) P.S. am just learning to program so this might be wrong | |
Hey there, this code was supposed to work out th GCD of 2 numbers added cout line in function and code seems to be running fine but it returns 4249024 instead of 29 this is probably a basic error on my part but can anyone tell me why? thanks for … | |
Hi, total beginner here, trying to learn at home. Just thought i'd get that in. if i have a number eg 123 trying to figure out a way of calculating all the possible cominations 123 132 213 231 312 321 can do it with pencil and paper but don't know … | |
Hey there. Just beginning to learn c++ on my own(not easy). Please fogive my lack of knowledge. I have a list of large numbers(50 digits) that i copied. I want to split them into an integer array of size [100][50]. I dont want to have to go through and put … | |
Hey there folks. New at this so forgive any mistakes, first post. I'm beginning to learn c++. Not so easy. After reading a few threads went to project euler. Problem i have is problem 3. " The prime factors of 13195 are 5,7,13 and 29. What is the largest prime … |
The End.