49,761 Topics

Member Avatar for
Member Avatar for bad.boy.Vlad

My function brokes. It gives 0 errors but brokes when i run it... int findk(int a,int b, int n) { int m[1000]; int j=1; for(i=1;i<=b;i++) { if((pow(2,i)>a)&&(pow(2,i)<b)) { m[j]= pow(2,i); j++; } } int k=m[1]; for(i=1;i<j;i++)if(m[i]>k)k=m[i]; return k; }

Member Avatar for richieking
0
117
Member Avatar for vampersie

/*Why i can't match the input with the constant string array? It always shows the record with -1 Thank you.*/ #include<iostream> #include <fstream> #include <iomanip> #include <cstdlib> #include <cstring> #include <string> #include <windows.h> #include <cmath> string stuname[3]={"Chan Tai Man, Peter","Ng Fat Tat", "Tsang Chi Wai"}; void searchStudent(){ string search; int …

Member Avatar for deceptikon
0
104
Member Avatar for SpottyBlue

I was practising the question before the final semester exam, and I have a problem. #include <iostream> #include <string.h> #include <cmath> using namespace std; int num; // A number needs to be entered int o_num; // Original number int r; string str1 = "", str2 = "", temp = ""; …

Member Avatar for deceptikon
0
111
Member Avatar for moon.fall.58

I seem to be having difficulty with my code, I have tried many different ways but I can't seem to figure out how to implement some things. I'm also not sure how to setup my menu so only certain functions are called. 1. Adding a if statement under ShowMenu to …

Member Avatar for tinstaafl
0
566
Member Avatar for asaidi

Hi can i run a program on windows compiled under ubuntu... simply..the program was wrotten on c++ under ubuntu os thanks

Member Avatar for iamthwee
0
105
Member Avatar for DTSCode

so i want to make a terminal for my website. im wondering how would i generate the html for the base of the terminal? ie just the window that i will be writing to

0
90
Member Avatar for tbuchli

/* * File: main.cpp * Author: TBuchli * * Write a program that helps a real estate agent calculate an average price of *up to 20 homes. An array of data type double should be used to contain the *prices. The program should prompt the user to enter the number …

Member Avatar for richieking
0
277
Member Avatar for TheFueley

I remember doing a class to handle rational numbers in one of my classes way back when. I decided to do it again. What I'm having trouble understanding right now is why do I even create a class when my overloaded functions are all friend functions? As I understand it, …

Member Avatar for TheFueley
0
676
Member Avatar for GamerDJX

I am currently working on a project for class that reads in from a .txt file the names of a film, the year it was made, and the list of actors in said film, and sorts the info in a binary search tree. In the tree nodes, I have the …

Member Avatar for GamerDJX
0
249
Member Avatar for royi.navon

/* the thing is that i need to check if a given number (n) is a palindrome. i also used limits.h to identify if the number is is exceeding the limit. i came up with this beut it's no good. any ideas? */ #include <iostream> #include <stdlib.h> #include <limits.h> #include …

Member Avatar for tinstaafl
0
133
Member Avatar for atzounis

Hello all, So here is my problem: I have 2 functions that one uses the other's calculations and result: int functionA(int a, int b) { int x = a+b; return x; } int functionB(int a, int b, int c) { int xx = x(a,b); int f = xx * c; …

Member Avatar for NathanOliver
0
267
Member Avatar for VUEKID

I need to read a text file, parse file, and check occurence of words without leading or trailing punctuations. this is what i have so far, std::ifstream f("textfile.txt"); std::istream_iterator<std::string> eof; std::multiset<std::string> words( std::istream_iterator<std::string>(f) , eof); for( std::multiset<std::string>::iterator i = words.begin(); i!=words.end(); i = words.upper_bound(*i) ) std::cout << *i<< ": " …

0
76
Member Avatar for glao

Hello, I wanted to ask. If I define `typedef float mymat3[3];` and then I have a function: void myfunc(float *One_mat_, .... and inside function I do: mymat3 * One_mat=(mymat3 *)One_mat_; while(i<numPoints) { One_mat[i][0] = (One_mat_[++c1]); Does this mean , that I am copying One_mat_ (which I am casting it as …

Member Avatar for glao
0
168
Member Avatar for moon.fall.58

I can't figure out how to add a loop to allow the user only three attempts to enter in a valid password. Any hlp would be appreciated it . #include <iostream> // cin and cout #include <cstring> // for string #include <conio.h> // for getch #include <cctype> // conversion using …

Member Avatar for richieking
0
1K
Member Avatar for MrAlicard

Hello I want to solve it randomly reads the lines. I found a source code, but it will crash the program. This is source code: DWORD cFindEvent::GetRandomPosition() { //--------------------------------------------------------------------------------------- FILE * garew = fopen (MobCoords,"r"); //--------------------------------------------------------------------------------------- char temp[1024]; int i = 0; int j = 0; int licz = rand() …

Member Avatar for MrAlicard
0
119
Member Avatar for klemek

My code is not reading my data file well. The code is supposed to read fractions from decending order, but it does not work half way through. please help! #include <iostream> #include <fstream> using namespace std; void read_data(int nums[],int den[],int size); void clean(int Cnum[],int nums[],int den[],int Cden[],int size); void low(int …

Member Avatar for richieking
0
147
Member Avatar for pro.soltan

i wanna ahelp please hospital project i have made aclass room composed of 4(class bed) i wana to initalization all rooms ids and all beds id once time not every time i run the programmme example room 1 ---->bed1,bed2,bed3 // bed class <<--- class bed{ int id; bool empty; public: …

Member Avatar for richieking
0
88
Member Avatar for cambalinho

//write void write() { setlocale(LC_ALL, "en_US.UTF-8"); cout <<""; } template <typename A, typename ...B> void write(string argHead, B... argTail) { setlocale(LC_ALL, "en_US.UTF-8"); if (blnBlink==true) { CONSOLE_SCREEN_BUFFER_INFO csbi; GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi); string a; a=argHead; TextBlink(a, csbi.dwCursorPosition.X, csbi.dwCursorPosition.Y,csbi.wAttributes); COORD Position; Position.X=csbi.dwCursorPosition.X+strlen(a.c_str()); Position.Y=csbi.dwCursorPosition.Y; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),Position); } else cout << argHead; write(argTail...); } template <typename A, …

Member Avatar for cambalinho
0
197
Member Avatar for pro.soltan

am doing my project phase 1 its about hospital : i have made a person class--patient inherite from it i wanna afunction to----add,alter,delete patient---------------- in text file the output 1--> add patient 2-->alter patient data 3-->delete a patient class person{ int id; string fname; string lname; string gender; int age; …

Member Avatar for pro.soltan
0
142
Member Avatar for sanim.akmal

As a lecturer, you are required to prepare an analysis of your student performance based on their marks. Therefore, you have to develop a software system that capable of doing so by evaluating their marks. The computer system that you will be developed must able to find the minimum, maximum …

Member Avatar for Learner010
0
96
Member Avatar for nileshjaiswal

Plz help me tell me how we can convert the C program in C++ I working on OCX(Active X controls) plzzzzzzzzzzz...............reply

Member Avatar for frta
0
759
Member Avatar for andrew mendonca

Here is the website for the assignment: http://www.docdroid.net/6ap6/inheritance5.pdf.html Note: The ones highlighted in blue are the ones I completed, and the ones highlighted in yellow are the ones I need help with. Here is the website for the first header file (point.h): http://ideone.com/6bAeqv Here is the website for the first …

Member Avatar for richieking
0
205
Member Avatar for Labdabeta

Hello, I am working on an event driven library and am having one minor problem. Basically I have two ways to get what I want done. Method 1: Smart pointers and factory functions #include <iostream> #include <vector> #include <memory> using namespace std; class Object { public: virtual int getInt(){return 0;} …

Member Avatar for Labdabeta
0
257
Member Avatar for charlie.puzjak

When would you open and close files within a function instead of in the main program? ________________________________________

Member Avatar for mike_2000_17
0
43
Member Avatar for DTSCode

so im trying to write a website in c++ using the treefrog framework. it all went fine following this tutorial http://www.treefrogframework.org/documents/tutorial and i got the page up, but i cant figure out what files i need to edit to actually edit the webpage itself. can anyone help?

0
126
Member Avatar for apiatex

write a function named, smallestValue, that accepts five integers and return the smallest integer accepted.( just write a function)

Member Avatar for phorce
0
188
Member Avatar for karanv
Member Avatar for amt_muk

Hello, Is there any utility which can generate sequence diagram from existing C++ source code? Thanx in advanced. Amitendra Mukherjee

0
70
Member Avatar for saja.omarii.7

A palindrome is a word or sentence that reads the same forward as it does backward. Write C++ code that read string consist of 6 characters only and check if the string palindrome word or NOT.

Member Avatar for Jamblaster
0
335
Member Avatar for qhweeman

please help i would like to Write a program that inputs three integers from the keyboard and prints the sum, average, product, smallest and largest of these numbers.

Member Avatar for Jamblaster
0
163

The End.