49,757 Topics

Member Avatar for
Member Avatar for pars99

So, I was doing some doing some research for a program I'm working on and I stumbled upon the information that clang++ is a better alternative to g++ on Mac. I've been trying to use it because I can define that I want to use C++11, yet, the file output …

Member Avatar for pars99
0
159
Member Avatar for Rootz

I am not sure why my program isn't writing to the text file. When I start the program it tells me that the file opens. Then I call the functions that are inherited from other classes and I would assume that it would write to the file and then display …

Member Avatar for Ancient Dragon
0
251
Member Avatar for codey666

I am trying to implement a search algorithm,it needs a tree with four(NOTE n=4) nodes.Is the struct declaration correct for array of structure pointers??You see the main idea is start with the 'cur' node.Then take a new 'temp' node. Copy the contents of 'cur->state' into 'temp->state' then perform the 'res' …

Member Avatar for codey666
0
306
Member Avatar for jkhippie

I wrote a game using an array of structs to represent a 9x9 grid. Now I'm re-writing it as a class to '++ it up' a bit and to better understand classes. Part of the game used a seperate struct to keep track of selected board squares (to see if …

Member Avatar for jkhippie
0
235
Member Avatar for ivan3510

Hi! I have this code and getting this problem: undefined reference to 'vtable for Triangle'. Thanks for your help! #include<iostream> using namespace std; class Point { public: float x,y; Point(){} Point(float x,float y):x(x),y(y){}; Point operator=(Point &X); }; Point Point::operator=(Point &X) { this->x=X.x; this->y=X.y; return *this; } class Figure { public: …

Member Avatar for ivan3510
0
4K
Member Avatar for chiste91

Hi. i need some help with this game i want to simulate with c++ (with the graphics.h library). i want to make a replica of Pacman. i already built the map, but now i got stuck: #1. i don't know how can i avoid the walls/obstacles (i have a blurry …

Member Avatar for shafaqsajjad
0
11K
Member Avatar for Fillipus

list the entire database in c++, what is the size of each of the data type

Member Avatar for rubberman
0
167
Member Avatar for ponnan

Sorry if I sounds mad...I have a some knowledge in c++ programing language. But I have been wondering if I can learn assembly language so that I can play with my pc as I like by programing it, creating DOS like programs and so on...but in my research I came …

Member Avatar for rubberman
0
428
Member Avatar for PulsarScript

//please can someone explain the output 4 8 12,why is it so? Thanks int count = 0; do { for( int i = 0; i < 4; i++ ) count++; cout << count << ‘ ‘; } while ( count < 10 );

Member Avatar for PulsarScript
0
197
Member Avatar for ckide

hi all i am using debian and installed sudo apt-get install mesa-common-dev and found this problem moc_mainwindow.o -L/home/damb/Qt5.2.1/5.2.1/gcc/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread /usr/bin/ld: cannot find -lGL collect2: error: ld returned 1 exit status make: *** [a] Error 1 20:41:04: The process "/usr/bin/make" exited with code 2. Error while building/deploying …

Member Avatar for panqnik
0
125
Member Avatar for willygstyle

Hi all... Can somebody explain to me why this code only works when I uncomment a specific line. It's not a crazy precision timer or anything just messing around atm, but don't understand the behavior. #include <iostream> #include <string> #include <time.h> // clock_t, clock, CLOCKS_PER_SEC unsigned int timer(){ clock_t t; …

Member Avatar for willygstyle
0
180
Member Avatar for nitish.mohiputlall

Question : In Bouboun University's Information Systems 3 arrays are used to store student details, 1. Stud_Names (array of strings) holds the name of 100 Students 2. Stud_Map (array of strings) hold the ids of the 100 students (whose details are stored in Stud_Name) 3. Stud_Marks_Mod1 (array of floats) holds …

Member Avatar for Ancient Dragon
0
287
Member Avatar for DS9596

I have to make a program that simulates a lottery. The program should have an array of 5 digits named winningdigits, a randomly generated number in the range of 0 through 9 for each element in the array. The program should ask the user to enter 5 digits and should …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for Praveen_10

#include <iostream> using namespace std; int *growArray (int* p_values, int cur_size); int main () { int next_element = 0; int size = 10; int *p_values = new int[ size ]; int val; cout << "Please enter a number: "; cin >> val; while ( val > 0 ) { if …

Member Avatar for nullptr
0
200
Member Avatar for smitsky

Hi. I'm having a problem accessing a function of an object which I put into a vector. When I try to read the vector at lines 503-506 , I get an output of whatever number I set my setTau() function, instead of the correct number. The beginning value for the …

Member Avatar for Ancient Dragon
0
216
Member Avatar for VertexF3

Hello guys :) I hope you are well. I have a problem, I am trying to build a 2D platformer and I am stuck when it comes to building the levels. I found a tutorial on how to build a tiling engine and I just got completely confussed. I am …

0
125
Member Avatar for Rootz

When I try to compile my code in visual basic 2010 it gives me the error 1903 and when I compile the code in Code::Blocks it opens the standard template library's algorithm.h file and takes me to line 2163 if (*__i < *__first) I don't want to modify anything here, …

Member Avatar for Rootz
0
833
Member Avatar for vacuum

I have developed an MDI MFC image viewer application for simultaneously viewing and comparing more than one images. In my application I need to implement dual monitor support which can view the displaying images in two monitors connected to the system and viewer should have provision to arrange the opened …

Member Avatar for Ancient Dragon
0
519
Member Avatar for Vikram Sehgal

So i have a code for a menu and i am facing some problem.. code:- do { ch = getch(); switch(ch) { case 'W': case 'w': system("CLS"); cout<<" MOD v1.0\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; cout << " --> PLAY\n\n"; cout<<" HELP\n\n"; cout<<" EXIT\n\n"; break; case 'E': case 'e': system("CLS"); cout<<" MOD v1.0\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; cout << …

Member Avatar for jkhippie
0
260
Member Avatar for nitish.mohiputlall

Question:write a function append that takes as input two queues Q1 and Q2, appends the content of Q2 to Q1 and returns Q1. The protoype of the function is: queue<float> append(queue<float> Q1, queue<float> Q2); My problem here im completly stuck i do not understand how to work it. here are …

Member Avatar for jkhippie
0
293
Member Avatar for shehata07

've created this code to find Sqrt without math.h but gives me wrong values ! So what is wrong ?? #include <iostream.h> #include <conio.h> main() { double n,end,start=0,mid; cin>>n; end=n/2; while(start<end) { mid=(start+end)/2; if ((n-(mid*mid)<=0.001) && (n-(mid*mid)>=0)) {cout<<mid;break; } if(n>mid*mid) {start=mid+0.001 ; end=end;} if(n<mid*mid) {end=mid-0.001; start=start;} } getch(); }

Member Avatar for shehata07
0
322
Member Avatar for mxwarning

Hello I am having trouble calling my addsomethingup() function. It keeps saying too few arguments in the function call. Can anyone let me know what I am doing wrong. I also can only get part of the output to work. I thought it was because of not calling the add …

Member Avatar for mxwarning
0
620
Member Avatar for jtjudge

Hello, Working with structures and C++. Our teacher in class attempted to show us how to over load an "<<" operator. I've tried to do that here in the program below without much luck. I have commented out some parts of the code while I am trying to debug this …

Member Avatar for Ancient Dragon
0
321
Member Avatar for cambalinho

"MFC is not a language; it is a native (unmanaged) class library which is a thin wrapper around the Win32 API." now see these header function: void CMyAxUICtrl::OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& /*rcInvalid*/) i belive the CMyAxUICtrl is the instance\object name but it's used outside of main function: …

Member Avatar for cambalinho
0
289
Member Avatar for Learner010

consider the following code afunction(int *x) { x=new int; *x=12; } int main() { int v=10; afunction(&v); cout<<v; } i expected `12` as the output but its wrong and correct one is `10` . But i don't know how this is done internally ? i was wondering if somebody could …

Member Avatar for StuXYZ
0
148
Member Avatar for ashley.vanhoesen.7

I need to remove the spaces and punctuation from the original string and the reverse string, then put the letters only into temp strings for comparision. When I run the output as it is now, I get 0000 for the temp strings. How do I fix this? Everything else is …

Member Avatar for mike_2000_17
0
681
Member Avatar for mxwarning

I am having a trouble calling my addsomethingup() function in my program. I keep getting the error too few arguments. Can anyone help me understand why this is not working please? #include <iostream> #include <string> #include <iomanip> using namespace std; using std::cout; // //CLASS DECLARATION SECTION // class EmployeeClass { …

Member Avatar for Learner010
0
255
Member Avatar for saif.shafqat.5

can any body please tell me that how to take input size of a matrix in 2 d array an then print the table of it.... sample output 1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 4 8 12 16 20 5 10 …

Member Avatar for Ancient Dragon
0
322
Member Avatar for pinkamech

Hi, I am currently working on a UNO Game using C++ and I am facing some troubles. I need to use Vectors and Pointers (for the main bulk for this assignment). I am wondering if anyone could kindly help me because the deadline is on Wednesday and I feel very …

Member Avatar for pinkamech
0
5K
Member Avatar for Vikram Sehgal

So I have made a menu and a guy helped me, We have used enum in the menu is there anyother way i can do it, cause my teacher is not allowing me to use classes, files and arrays, please help, if u guys have anything simple and better i …

Member Avatar for Stavros_1
-1
282

The End.