49,761 Topics

Member Avatar for
Member Avatar for mike_2000_17

Following up on a discussion on [this thread](http://www.daniweb.com/software-development/cpp/threads/470519/looping-using-recursion/), I did some tests on the performance of recursion vs. iteration, and some interesting things happened, so I thought I would share the results. I'm gonna structure this a bit like a lab-report, because that's really the best way to put it. …

Member Avatar for Tumlee
4
673
Member Avatar for Ashneel Chand

Design an online lottery game in C++ which will randomly store 6 number in the range of 1 to 30 as the winning numbers. Then it will ask the user to enter 6 numbers of their choice and match with the winning numbers. It should display the following: “Jackpot” for …

Member Avatar for duskoKoscica
0
533
Member Avatar for johnson_2

I have a c++ file in xcode that I want to import to netbeans the problem is the c++ file is lacking some files which netbeans requires in order to open that up in netbeans(e.g makefile) How do I do that?

Member Avatar for Moschops
0
151
Member Avatar for djbsabkcb

Below is my code for printing prime numbers up to a given input by user. However, my calculations are not working correctly and my output is printing twice. Any idea? :sad: #include <iostream> #include <cmath> using namespace std; void prime_num(int); int main() { cout << " Enter a number and …

Member Avatar for duskoKoscica
-2
2K
Member Avatar for rajan1990

I am making a game in cocos2dx(c++).Here i have to make dynamic sprites that are falling top to down and on touch i have to kill them.I mean the sprites are of insects and they will be killed on touch The problem is that I am unable to get the …

Member Avatar for Ancient Dragon
0
52
Member Avatar for sinnerbynature

#include<windows.h> #include<iostream> using namespace std; int card[9],usercard[7],comcard[7],cardsuit[9]; void winner(); void highest(); void gotoxy(int x,int y) { COORD CursorPosition; CursorPosition.X=x; CursorPosition.Y=y; SetConsoleCursorPosition((GetStdHandle(STD_OUTPUT_HANDLE)),CursorPosition); } void decone(int num,int x,int y) { int i; char suit; if(num<15) { suit=3; } else if(num>14 && num<28) { suit=4; num=num-13; } else if(num>27 && num<41) { suit=5; …

Member Avatar for Ancient Dragon
-1
178
Member Avatar for sinnerbynature

The below program is working but it have some constraint #include<windows.h> #include<iostream> using namespace std; void gotoxy(int x,int y) { COORD CursorPosition; CursorPosition.X=x; CursorPosition.Y=y; SetConsoleCursorPosition((GetStdHandle(STD_OUTPUT_HANDLE)),CursorPosition); } void decone(int num,char suit,int x,int y) { int i; for(i=0;i<200000000;i++); gotoxy(x,y); for(i=0;i<11;i++) { cout<<"*"; } y++; gotoxy(x,y); cout<<"*"; gotoxy(x+10,y); cout<<"*"; y++; gotoxy(x,y); cout<<"* "<<suit; …

Member Avatar for Ancient Dragon
0
235
Member Avatar for ali hassan q

finds the average number of hours per day spent programming by each student over a three-day weekend. User should enter the number of hours worked each day and number of students.

Member Avatar for Moschops
0
398
Member Avatar for dev1902

Hello, I need help in solving 3 errors in my C++ code The first error is** line 95 'output_minus_10' was not declared in the scope** The Second error is **line 96 'output_plus_10' was not declared in the scope** The warning is **line 104 unused variable 'R_junction'** #include <cstdio> #include <cmath> …

Member Avatar for MathewsSolve
0
209
Member Avatar for jyotidighe
Member Avatar for 2lethal

Good day, I must be blind .. I am developing my first "Visual Studio" desktop application. My apps are normally always Internet Apps. I have about 20 text boxes, but I want to give the user the ability of pressing Enter, and "defaulting" to the Enter button on the screen. …

Member Avatar for 2lethal
0
207
Member Avatar for pravej

Hi, I have a txt file that contain certain data inside it. Example of the txt file: Name=John Age=20 Address=c-34, Newyork Name=Martin Age=23 Address=123, New Delhi .... .... and so on..... Now I have to process the each line get from the file and put the values into arrays. arr_name, …

Member Avatar for Ancient Dragon
0
6K
Member Avatar for missil9

Hello, I am currently trying to use boost asio for IPC. I ran into 2 strange issues: 1) when using the acceptor class, when I bring my process up, I get the error 'Already open' when trying to listen. The port I am trying to bind to is definitely not …

Member Avatar for missil9
0
763
Member Avatar for raliot

Compile program functions for: -Enter of a keyboard and a file into an array (by adding) data to 30 girls in the competition "Miss World" number, name, surname, date of birth, physical data, state and display the current contents of the array on the screen -display output data for a …

Member Avatar for Paul.Esson
0
139
Member Avatar for Adeel Rahat
Member Avatar for Vivitha

I executed a simple C++ program in Visual Studio2010 using OpencV version 2.2 to start the camera and display the video simaltaneously.But the camera gets started and only the window came as output and not the video capture simaltaneously..Here is my code.Is there any error in camera..Do we need to …

Member Avatar for Paul.Esson
0
203
Member Avatar for andreas.petrou.967

I have this program,how to find reverse numbers? #include<iostream> #include<fstream> #include<string> using namespace std; const int array_size = 10; //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //function to enter the number choise1/// to "&" dieuthinsi noumerou void get_numbers(int num_arr[array_size], int& numbers){ int count; cout << "How many numbers do you want to enter? "<<endl; cin >> …

Member Avatar for kplcjl
0
358
Member Avatar for Salman_3

Problem: A salesman travels from one to another state. he may visit either n=2,3,4,5 or 6 cities of punjab. For every number of cities he may adopt different routes. Some routes will be longer and other rwill be shorter. We neeed to design a C++ Program. *TO DISPLAY EACH ROUTE …

Member Avatar for ArashVenus
0
181
Member Avatar for Qazi_1

Hi guys, Tomorrow is my theory paper exam of C++ OOP and Data Strucutre. Paper will be based on 50% theory Q/A and 50% on coding implentaion. Can you give me some hints to prepare for this coming exam? PS. I have gone throw all lectures slides and course material, …

Member Avatar for mathijs
0
254
Member Avatar for STVG

i'm working on a array header from base definition of an array to create an array of any type with this header,so i created a array class with functions and constructors. this is my code so far: #include <iostream> #define newline "\n" class Arr { public: typedef float T; public: …

Member Avatar for deceptikon
0
432
Member Avatar for nkwaga

Write a program to compute and print the number of miles a car has travelled during 2013 and compute the average litre comsumption per mile. the program shouls ask for daily number of miles, also give its output the total amount spent on petrol for the year.

Member Avatar for Paul.Esson
0
124
Member Avatar for learncoding

I have a vector personInfo that contains class objects of person details vector<person> personInfo; I am trying to use std::find to search for a existing name in the vector. I overloaded my == operator. person.h class person { public: std::string name; friend bool operator==(const person &lhs, const person &rhs); }; …

Member Avatar for Paul.Esson
0
512
Member Avatar for Hassan Sani

Write a program to evaluate the feed back of teacher accordingto following questions. 1. Behaviour of teaching in class. 2. Teaching style in class. 3. Questing Methaelogies they adopt. You to judge on the basic of following critenia. 1. Not Goog 2. Natural 3. Good

Member Avatar for learncoding
0
50
Member Avatar for karaman1

Hello guys,i have some issues uploading a task 10152(shellsort) in the online judge website. The code works fine,i get the results you need to get on my computer,but when i try to upload it on the site it tells me that i have an error. this is the code: #include …

Member Avatar for Meron Aragaw
0
122
Member Avatar for salah_saleh

Hi, I want some recommendation for libraries written in C/C++ that has iterative solvers like Jacobi, Gauss-Seidel or SOR, Does anybody have a recommendation? Thanks!

Member Avatar for tinstaafl
0
97
Member Avatar for Lp_baez

I am looking for a noob friendly C++ IDE for mac computers. I'm looking something similar to microsoft visual studio. I have tried xcode, but it appears to be missing some of the basic cpp. and h. files like stdafx.

Member Avatar for mike_2000_17
0
438
Member Avatar for mixelplik

I was writing a program that opens a file assigns each element to an array. I was wondering if anyone had suggestions on how to get the number of items in a file, without knowing before hand. I was usuing this: int main() { ifstream inputFile; inputFile.open("P6.txt"); int index = …

Member Avatar for Ancient Dragon
0
357
Member Avatar for yogesh_6

//this is a mine...sieve's algorithm implementation please tell me where i am going wrong...// #include<iostream> #include<vector> using namespace std; int main() { int a,b,p; vector<int> v; cin>>a>>b; for(int i=a;i<=b;i++) v.push_back(i);//inserting all values upto given limit in a vector.. for(p=2;(p*p)<=b;p++) { for(int n=2;(n*p)<=b;n++) { int s=(n*p); v.erase(v.begin()+s);//erase all multiples of 2,3....from …

Member Avatar for Tumlee
0
186
Member Avatar for learncoding

Ihave a vector that contains monthyear Jan2013 Jan2013 Jan2013 Jan2014 Jan2014 Jan2014 Jan2014 Feb2014 Feb2014 Basically what I want to do is to search through the vector, for every same record, group them together like e.g total count for Jan2013 = 3; total count for Jan2014 = 4; total count …

Member Avatar for NathanOliver
0
163
Member Avatar for daviddoria

I would like to take a screenshot of a region of my screen programmatically (so I can do it every time through a loop, for example.) Does anyone know how to do this? I guess it would involve the win32api - I've not used this before so any hints would …

Member Avatar for dougy83
0
3K

The End.