49,757 Topics

Member Avatar for
Member Avatar for rekhamanoj
Member Avatar for tvm78

Alright, so I am designing a program that contains binary trees to function as a parser. I have encounted a very strange problem that is causing my program to fail while it is running. I have done several tests and narrowed down the incidents. Ok, so this results in a …

Member Avatar for mike_2000_17
0
351
Member Avatar for Vasthor
Member Avatar for mike_2000_17
0
154
Member Avatar for Dev93

I tried to run the basic code to create and open a window . The code is as follows : #include <iostream> #include <SFML/Window.hpp> int main() { // Create the main window sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window"); // Start main loop bool Running = true; while (Running) { App.Display(); …

Member Avatar for Dev93
0
379
Member Avatar for dreday92

I was wondering why the compiler keeps telling me #include <iostream> #include <fstream> #include <iomanip> #include <cstdlib> #include <string> using namespace std; const int PatternSize = 8; typedef int OperandArray[PatternSize]; // the major data structure, the BitPattern class class BitPattern { public: // default constructor, sets all bits to zero …

Member Avatar for sfuo
0
104
Member Avatar for poloblue

Good Morning, I'm a little difficulty in writing and implementing a function that read a list of words of variable lengths and convert all letters to upper case. Ask the user to enter the size of the list. I shall use an array as pointers. So far, I have this, …

Member Avatar for WaltP
0
200
Member Avatar for madhusudan.srinivasan

#include<iostream.h> #include<conio.h> #include<string.h> int main() { clrscr(); char string1[20],string2[15]; int i,j; string1="AMITABH BACHCHAN"; string2="RAJNIKANTH"; int n1=strlen(string1); int n2=strlen(string2); cout<<"common alphabets in AMITABH BACHCHAN AND RAJNIKANTH are-"; for(i=0;i<n1;i++) { for(j=0;j<n2;j++) { if(string1[i]==string2[j]) cout<<string[i]; } } }

Member Avatar for ravenous
0
241
Member Avatar for zvjezdan.veselinovic

I am trying to make a program where when I click an arrow key, the object moves constantly until I click another arrow key; or, when my object reaches a wall and crashes. For my code, I have made arrow key movements, I have assigned them in the program, and …

Member Avatar for zvjezdan.veselinovic
0
173
Member Avatar for theguitarist

Hi. I have some trouble understanding the linking process and hence this related question. Lets say I need a global variable that is needed by every single source file in my project. I would create a `constants.h` header and put `extern const int var;` in it. In corresponding source, `constants.cpp`, …

Member Avatar for mike_2000_17
0
6K
Member Avatar for ConfusedLearner

Keep saying The variable 'width' is being used without being initialized. #include <iostream> #include <cmath> using namespace std; int main() { float length; float width; float area; cout << "Enter The Length Of The Rectangle: "; cin >> length; area=length*width; cout <<"The area of the rectangle is : "<< area …

Member Avatar for np complete
0
181
Member Avatar for venomxxl

Hello I'm not new to C++ programming, but I have a question for you guys and gals :) So the code below compiles fine (due to that ugly workaround in main func), but that makes d_copy.field2 unitialized (0xCC bytes in MSVC). How would you change the code to make d …

Member Avatar for venomxxl
0
117
Member Avatar for IanKent

So, we are making a card game for class using a deck of cards valued 1 to 52, using lists and stacks. It deals each player a card, compares the value, then awards a point to the winner and restarts. I am using stacks to keep track of points, and …

Member Avatar for deceptikon
0
118
Member Avatar for Dersev

Hi I have a question about memory address on Windows Mobile 5.0 I found application pid by task manager which I downloaded from internet. Is it possible to find memory addresses by pid on Windows Mobile ? I know that VisualC++ has built in methods but for desktop Windows. I …

0
132
Member Avatar for mferarri

Hi all, I am learning to code in c++ on Linux Mint 13. I am going through an exercise drill in a book called "Programming Principles and Practice using c++ by Bjarne Strustrup". I have a couple of questions. - I am having trouble with the calling the error function …

Member Avatar for mferarri
0
172
Member Avatar for VernonDozier

Someone a few months ago told me that I had to change a bunch of code from stuff like this... // config_options.h // define _FOO if and only if you want option foo to be available #ifndef _FOO #define _FOO #endif // main.cpp #include "config_options.h" #ifdef _FOO void foo() { …

Member Avatar for VernonDozier
0
771
Member Avatar for triumphost

What am I doing wrong? In the following templated functions, I'm trying to convert all my CopyMemory functions to std::copy functions. I'm not sure what I'm doing wrong as they don't work as they should with the std::copy but instead, they work with memcpy and CopyMemory. I'm only doing it …

Member Avatar for vijayan121
0
508
Member Avatar for mke48

I'm having problems with the code below. I figured since Monster1=new Orc 's attack function can't know whether it's attacking a Troll or Goblin since it accepts an Entity pointer as an argument. But having the be_attacked functions doesn't help either #include<iostream> using namespace std; class Entity { public: virtual …

Member Avatar for vijayan121
0
145
Member Avatar for harris24

Hi, I've posted m code below and cant get it to work because of *fatal error c1004 unexpected end-of-file found*. Appreciate any help. #include <iostream> using namespace std; /* //what i addedint q[8][8]; void printSolution();//int q[]); void hereQueen(int q[], int n1, int n2); */ class Queens { bool canGo; int …

Member Avatar for harris24
0
511
Member Avatar for np complete
Member Avatar for WaltP
0
242
Member Avatar for triumphost

Why is C++ on linux basically C? I've tried everything to avoid C on linux but it's simply near impossible. I've tried to stick directly to the standard library but I somehow find myself using dirent.h, types.h, etc.. Is there any other ways to do these other than using C …

Member Avatar for deceptikon
0
757
Member Avatar for Dev93

I have just started getting into SFML and Visual studio as well . I have always worked on turbo c++ . I am not sure I understand the very first code that I have come across while getting into SFML . Here is the program.. #include<iostream> #include<SFML\System.hpp> int main() { …

Member Avatar for Bob
0
387
Member Avatar for Dev93

What should be the output to the following code ? I am confused because I am getting a slightly different output everytime . Any other advise would also be appreciated . #include<iostream> #include<SFML\System.hpp> void apple_thread(void *data) { using namespace std; for(int i = 5 ; i<11 ; i++) { cout<<"I …

Member Avatar for Ancient Dragon
0
332
Member Avatar for mke48

I'm having a problem with the code below. Can anyone help me? #include <iostream> #include <string> using namespace std; class Aircraft { public: Aircraft() : MPrice(0), LPrice(0), BPrice(0), PPrice(0), TotalPrice(0) , Stars(0) {cout<<"aircraft constructor"<<endl;} virtual ~Aircraft(){cout<<"aircraft destructor"<<endl;} protected: string Missile; string Laser; string Bomb; string Propulsion; int MPrice, LPrice, BPrice, …

Member Avatar for jacob.lemelincarrier
0
3K
Member Avatar for firdousahmad
Member Avatar for daino

I'm having a little bit of trouble getting a start on WXWidgets. Sure, I can add the controls to the Frame though I'm a little stuck on how they should work. I know how to use the standard events already built into WXWidgets but there's something else I need to …

0
68
Member Avatar for zahra.elmi.3

I also work on copyright protection project using DCT on opencv. I have a problem, I have a code in opencv2.4 and I want to chenage to 2.1, but I can't do it. please help me Mat colorImageROI= dct_logo(cv::Rect(dct_image.cols/2,dct_image.rows,dct_logo.cols,dct_logo.rows)); // obtain iterator at initial position. Mat_::iterator srcIt = dct_logo.begin(); // …

0
43
Member Avatar for kshahnazari

hey guys reading deitel book and have a little problem with the code that I cant understand #include <iostream> using std::cout; using std::endl; #include <iomanip> using std::setw; int main() { // define array sizes const int responseSize = 40; // size of array responses const int frequencySize = 11; // …

Member Avatar for NathanOliver
0
177
Member Avatar for tones1986

Hey folks, I am working on a project (its a continuation of my previous project)... but with a few additions. First off, i have to use class templates... I have used them before, but not when working with multiple class definitions and multiple files. Below i will post sections of …

Member Avatar for programmerkk
0
268
Member Avatar for lscamaro

Hey guys! I'm having a problem and I hope you guys can help me figure it out. I have to create a program that prints all the armstrong numbers from a user given lower and upper bound. I have a lot of the code but I can't seem to get …

Member Avatar for np complete
0
123
Member Avatar for PikapikaPi

Make a program that counts, identifying every value divisible by 3 and 5. If it is divisible by 3, put an asterisk (*) beside it. If it is divisible by 5, put a tilde (~) beside it. Print the first 200 values. Can someone help me? i don't actually know …

Member Avatar for 2teez
0
179

The End.