244 Posted Topics

Member Avatar for OrangeGrover

This may work. [CODE]for(i=0;i<DetectedFaces.size();i++) { temp.push_back(DetectFaces[i]); }[/CODE]

Member Avatar for OrangeGrover
0
320
Member Avatar for jordankaushik

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]

Member Avatar for Narue
0
149
Member Avatar for AmerJamil
Member Avatar for effizy

[CODE]#includes <iostream>; [/CODE] maybe [CODE]#include <iostream>[/CODE] would work better.

Member Avatar for daviddoria
0
259
Member Avatar for MarounMaroun

@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?

Member Avatar for frogboy77
0
96
Member Avatar for FutureWebDev

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.

Member Avatar for FutureWebDev
0
197
Member Avatar for johntodo
Member Avatar for frogboy77
0
132
Member Avatar for Bschober

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 …

Member Avatar for Bschober
0
352
Member Avatar for twinb
Member Avatar for frogboy77
0
121
Member Avatar for Marissak

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]

Member Avatar for Marissak
0
236
Member Avatar for kuchick32
Member Avatar for frogboy77
0
132
Member Avatar for frogboy77

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 …

Member Avatar for frogboy77
0
208
Member Avatar for skorm909
Member Avatar for frogboy77

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.:)

Member Avatar for frogboy77
0
89
Member Avatar for mybluehair
Member Avatar for frogboy77

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.

Member Avatar for frogboy77
0
75
Member Avatar for alaa sam

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 …

Member Avatar for alaa sam
0
106
Member Avatar for geryin
Member Avatar for frogboy77

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 …

Member Avatar for gerard4143
0
222
Member Avatar for babylonlion

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.:)

Member Avatar for frogboy77
0
2K
Member Avatar for frogboy77

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? …

Member Avatar for frogboy77
0
97
Member Avatar for ccube921

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 …

Member Avatar for frogboy77
0
174
Member Avatar for frogboy77

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 …

Member Avatar for frogboy77
0
123
Member Avatar for frogboy77

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 …

Member Avatar for frogboy77
0
140
Member Avatar for frogboy77

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 …

Member Avatar for frogboy77
0
322
Member Avatar for it-lady
Member Avatar for it-lady
-1
100
Member Avatar for sampk2002

then you will have to learn or you will fail(rightly so). no help will be given to you to trick your professor

Member Avatar for frogboy77
-2
112
Member Avatar for kelvindata
Member Avatar for exekiel101
Member Avatar for anantk
-1
105
Member Avatar for frogboy77

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 …

Member Avatar for frogboy77
0
119
Member Avatar for Sirovica

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. …

Member Avatar for frogboy77
0
149
Member Avatar for ryathegr8
Member Avatar for kakaliki

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 …

Member Avatar for kakaliki
0
207
Member Avatar for rodel~
Member Avatar for gurram srinath
Member Avatar for frogboy77
-2
109
Member Avatar for frogboy77

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?

Member Avatar for Fbody
0
142
Member Avatar for frogboy77

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 …

Member Avatar for frogboy77
0
90
Member Avatar for frogboy77

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 …

Member Avatar for frogboy77
0
124
Member Avatar for Bri426
Member Avatar for burcin erek

line 9 should read for(index=0; index < strlen(pointer); index++) P.S. am just learning to program so this might be wrong

Member Avatar for burcin erek
0
90
Member Avatar for frogboy77

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 …

Member Avatar for arkoenig
0
103
Member Avatar for frogboy77

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 …

Member Avatar for frogboy77
0
84
Member Avatar for frogboy77

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 …

Member Avatar for frogboy77
0
128
Member Avatar for frogboy77

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 …

Member Avatar for frogboy77
0
723

The End.