49,757 Topics

Member Avatar for
Member Avatar for rafta

Iam trying to code a single program of an array with 20 elements in it. It asks for a number from user and search is if this array has that number. I am using Binary and selection search. Its not giving me the required results. here is my code; [CODE]/* …

Member Avatar for vmanes
0
111
Member Avatar for Ponomous

So this is a matching game, flip over two cards, if they match they stay up if not they flip over again. I have the matching system and coordinate system working. My problem is that when i use my array of zeros to "hide" the numbers, all that is ever …

Member Avatar for Ponomous
0
98
Member Avatar for kurt_tna
Member Avatar for username4
0
105
Member Avatar for JenniLei

Hello guys, I am having trouble getting an asyncronous communications set up using overlapping. Actually to be more specific I am having problems with using httpWaitForDisconnect to work as async. Using the code below I am able to enter the function, but it is in a blocking state which defeats …

Member Avatar for JenniLei
0
249
Member Avatar for ihtesham4deni

Problem Statement: File Handling in C/C++ On the basis of the given scenario create a file Expenses.txt, Open the file and copy into another Expenses2.txt, Also show output on screen A college has announced the total budget of 50,000Rs.for each game. Games are done four times in a year. Take …

Member Avatar for donaldw
0
108
Member Avatar for spekulanta

Hi there, here what my problem is - I'm trying to get data from MySQL database put in on global array and make calculation. The data in the MySQL table is 3000 rows and 2 columns. The type of data is double and date Here is the code: [CODE] #include …

Member Avatar for spekulanta
0
124
Member Avatar for FeVerSeCtioN

ok.. its really hard and takes time and knowlage of C++.. i hope i am in the right section for this.. if no please the mods move it to the right one.. Whoever manage to make over it... is god for me. i can give one premium rs account valid …

Member Avatar for FeVerSeCtioN
-5
136
Member Avatar for EvolutionFallen

Hello, My professor has asked me to write a C# GUI for a C++ program. I did not write the C++ program (hell, I'm not even completely sure what it does -- something to do with pattern recognition). I wanted to know how one would go about writing a C# …

Member Avatar for DdoubleD
0
853
Member Avatar for Flybro

Hi guys, I'm trying to write a small program which will search a file for few bytes and replace it with another bunch of bytes. But everytime I try running this small app I got message about [B][I]istream_iterator is not dereferenceable[/I][/B]. I'm even not sure that I know how exactly …

Member Avatar for quetzalcoatl.pl
0
76
Member Avatar for Clockowl

Hey guys, I have this code snippet: [code=cpp] template <typename ElementType, typename CompareClass> struct Delegate { virtual bool geef(const ElementType &element){ pair <set<ElementType, CompareClass>::iterator, bool> ret; //this is line 196 ret = elements.insert(element); //197 return (ret.second); //198 } virtual void output() = 0; set<ElementType, CompareClass> elements; }; struct ArtiestenPrinter : …

Member Avatar for Clockowl
0
218
Member Avatar for nick30266

the program is ok(i think)but the data is fixed.i want it able to input your own data.i tried cin>>c1.real>>c1.image; cin>>c2.real>>c2.image; but it cannot use them because they are private... [code=cplusplus] #include<iostream> using namespace std; class complex { public: complex(){real=0;image=0;} complex(double r,double i){real=r;image=i;} complex complex_add(complex &c2); complex complex_sub(complex &c2); complex complex_mult(complex …

Member Avatar for mrnutty
0
343
Member Avatar for vinochick

I have to write a program that allows a user to pick five numbers from one to 55. The computer will then generate 5 random numbers and determine how many of the users choices match the generated numbers. I have to create an algorithm for this program. The program will …

Member Avatar for pecet
0
2K
Member Avatar for jinjishu

I am currently stuck on part a of this problem. I am having a problem with my stub, I am also running this on visual C++ 2008 express. My stub is a program i had to create to find the maximum value from the 10x20 array. For some reason that's …

Member Avatar for jinjishu
0
363
Member Avatar for denizen08

[CODE]#include <cmath> long double NR(long double sample) { return (abs(f(sample)))<=1e-10 ? sample: NR( (sample - f(sample)/fp(sample))); } long double f(long double sample) { return 2.5*exp(-sample)-3*sin(sample); } long double fp(long double sample) { return -2.5*exp(-sample)-3*cos(sample); }[/CODE] I'm trying to write code for a Newton-Raphson algorithm. I have it in recursive form …

Member Avatar for denizen08
0
180
Member Avatar for Ponomous

Hey, so im trying to make a memory game using 2d arrays. This is my code to randomly generate the rows and columns but its not giving me pairs, could someone tell me why, i really dont know. [CODE] for (int r=0; r<4; r++) { for (int c=0; c<4; c++) …

Member Avatar for vb6exp32
0
232
Member Avatar for maverick405

This program passes two parallel arrays ta a function that prints the grade reports i.e Jay Rino -- Grade: A, I had coded this program as per my knowledge but it does not executed well please help me solve this. I know there is no user input needed but I …

Member Avatar for maverick405
0
130
Member Avatar for guccitan88

Hi, new learner to C++. I have to write 4 functions to compute and return the diameter, circumference, etc. of a circle. I think I might be on the right track but I'm probably making this harder than it has to be. I commented most code out because I'd like …

Member Avatar for guccitan88
0
101
Member Avatar for maverick405

This program runs perfect just want to know if I have to do this arithmetic operations using functions how can I do that? [code] // Arithmetic.cpp - This program performs arithmetic, ( +. -, *. / ) on two numbers. // Input: Interactive // Output: Result of arithmetic operation #include …

Member Avatar for mrnutty
1
119
Member Avatar for wyett

So, I'm asking a user to input a fraction in the form of this: +3 3/4 I know I can use a search to find where the first instance of something happens, but how do I actually take whats before it? Example: I can tell it to search for white …

Member Avatar for wyett
1
112
Member Avatar for Clockowl
Member Avatar for scriptkiddy

Hi. I want to include an email function in my program. So that if anybody needs to ask me a question, they can use my program to send me an email. I want to do this this way: I want my program to connect to my website, and post data …

Member Avatar for Ancient Dragon
0
180
Member Avatar for mampam

Hi, I am having a user input a series of numbers and characters separated by spaces. like "10 23 65 34 765 34 65 34 64 354 64" and i need to put these into an array without the spaces. I stores them into a string but whenever i do …

Member Avatar for VernonDozier
0
112
Member Avatar for unsure

I have tried and tried to figure out what it is I am have wrong. I have an assignment to create a program that calculates employee's bonus. I think I pretty much have it, but I keep getting an error that I cant figure out and what the error is …

Member Avatar for Nick Evan
0
136
Member Avatar for crisis123

[CODE] memset( sDate, 0, sizeof(sDate)); tempSize = strlen( argv[1] ); for ( j = tempSize - 1; j >= 0; j--) { if ( *(argv[1] + j) == '/' ) { j = j + 7; strncpy( sDate, argv[1] + j, 8 ); break; } }[/CODE]

Member Avatar for crisis123
0
66
Member Avatar for iammfa

Hi, with c++, what is the steps to make centered 2d sprite rotate oriented toward mouse cursor, i heard that i should use trigonometry.. can someone tell me these steps without coding regards iammfa

Member Avatar for mrnutty
0
270
Member Avatar for Ponomous

So i am writing a program that plays the old memory card game (ie you have a 4x4 block of playing cards, flip 2, if they match they stay up, if not they flip back over). I am having trouble generating the random pairs of cards (i got the 4x4 …

Member Avatar for sfuo
0
87
Member Avatar for MooAndStuff

Ive been having some trouble recently with a copy constructor (related to an assigment operator which is overloaded).... ive been getting segmentation fault, and Im pretty sure that i've narrowed it down to the copy constructor Anyway, here is my code for the copy constructor: [CODE] template <typename L> List<L>::List(const …

Member Avatar for MooAndStuff
0
1K
Member Avatar for davzi

Hi I was wondering if you could help me with a question on image processing. I am using c++to process the image.I have a raw file, and I have read it by creating an fstream, and have saved the length of the file in variable end. [CODE] #include <iostream> #include …

Member Avatar for davzi
0
2K
Member Avatar for maverick0612

I would like to implement a program that accepts if statements and then based on grammar rules provided, validates those statements by parsing each statement into tokens. I thought about it and thought that I would read each line in as a string, break it into tokens and validate each …

Member Avatar for Ancient Dragon
0
101
Member Avatar for Behi Jon

Hi, When I want to get a string with getline function, it jumps from this statement without getting string . Because I get an integer number before it and the \n is pressed . To solving this problem I use cin >> ws before getting string with getline function . …

Member Avatar for Behi Jon
0
145

The End.