49,756 Topics

Member Avatar for
Member Avatar for lmytilin

I'm a little lost with C++ so I could really use your help with this one! I googled it but nothing does what I want to do! So here is my problem... Let's say I have a file like this: A 10 20 30 40 B 25 13 100 99 …

Member Avatar for Lerner
0
176
Member Avatar for bobanderson93

every time i run the program it prints out 0. I think something is wrong with my display function but i cant see the problem. [CODE]#include <iostream> using namespace std; #define STACKSIZE 10 class stack { private: int arr[STACKSIZE+1]; int tos; public: stack(); void push(int x); int pop(); bool is_empty(); …

Member Avatar for richieking
0
133
Member Avatar for jonnyboy12

Hello all. I am trying to figure our how to add a pin and unpin button on one of my ms visual forms. An example of this is the pin that in used on the top right of the solution explorer in ms visual. I know that in the basic …

0
59
Member Avatar for Smartflight

We have been assigned to make a program for a bank using data file handling, as our project. I am having some trouble at this point... the last object written in the file is printed twice and I've no clue as to why. Case for display: [CODE]file.open("Records.dat", ios::in | ios::binary); …

Member Avatar for WaltP
0
553
Member Avatar for triumphost

Sorry for using Inception in the title but it's the only way I think I can describe it.. Take this for example: Definition.H [CODE] struct XY { string info; string name; string tag; string attrib; }; //is it better to create an object here inorder to make the array? struct …

Member Avatar for triumphost
0
139
Member Avatar for vyrte

hello everyone! i'd like to know if theres a way to run my program until the user presses Esc button. i use linux environment and my main function runs fork().i want the program to stop the fork() when the user presses escape. thank you!

Member Avatar for WaltP
0
172
Member Avatar for jigglymig

I am trying to make a circular linked list and I think I am not linking it properly in the middle area because I can print the last and first node, but not the rest... [CODE]#include <iostream> #include <new> using namespace std; struct node { int Item; node* Next; }; …

Member Avatar for Lerner
0
105
Member Avatar for PainOfTruth

Please help me run this program, i forgot the output of this.. [CODE] #include<iostream> #include<cmath> using namespace std; class SumTwoNumbers { int nx,ny,sum,suma,sumtn; public: int GetFirstNumber(); int GetSecondNumber(); int GetSum(int,int); void Display(int,int); }stn; int SumTwoNumbers::GetFirstNumber() sum=nx+ny; //here is where the errors i wrote below points! i dont know why return(sum); …

Member Avatar for sharathg.satya
0
413
Member Avatar for Ayzu

I'm trying to implement priority queue using a singly linked list, but the program is not running in the best way, n the display function is showing just first n last node's data , y??? [CODE]#include<iostream.h> #include<conio.h> struct node { int n,p,b; // Data members for getting Task no. ,Priority …

Member Avatar for Ayzu
0
234
Member Avatar for venky019

Hi, I got this error while trying to access the method that I've posted here. Main program: cin>>sname; string x; Sports x = Sports.getName();//error:a nonstatic member reference must be relative to a specific object. loc=x.find(sname); In Sports.cpp: string Sports::getName() {return name;} I've declared getName() function as public.Still I'm getting this …

Member Avatar for Ancient Dragon
0
3K
Member Avatar for ichigo_cool

Hey everyone, I've made a game with SDL and I'm now trying to distribute it. I've included all of the required .DLLs and such but now I get this error whenever I try to run the .exe: The application or DLL E:\GAME\DEBUG\MSVCR100.dll is not a valid Windows image. please check …

Member Avatar for Tumlee
0
456
Member Avatar for jdm

I'm writing a dayType class program and I'm having trouble with comparing two different days to each other. Here is what I have for them: bool dayType::equalDay(const dayType& otherday) const { } and here is main: if (day.equalDay(newday)) cout << " equal days" << endl; else cout << "not equal …

Member Avatar for jdm
0
95
Member Avatar for LucyButterfly22

Hey guys, I'm fairly new to C++ and I was wondering if I could get a hand with something. I'm trying to write a program that will create something called an anti-saccade task, in which the subject of the experiment would have to look away from the stimulus, for my …

Member Avatar for DeanMSands3
0
102
Member Avatar for sync101

Hi there, I am new to C++, and was wondering if someone could write an example program for me to work with. What I would like to do is take input from stdin and then display the translate output to stdout. Example: Input: [code] (color 0 0 0.1) // These …

Member Avatar for jaskij
0
103
Member Avatar for stereomatching

[code] struct String { String() { std::cout<<"String::String(), this="<<this<<std::endl; } ~String() { std::cout<<"String::~String(), this="<<this<<std::endl; } String(String const &other) { std::cout<<"String::String(String const &other), this="<<this; std::cout<<", other="<<&other<<std::endl; } String& operator=(String const &other) { std::cout<<"String::operator=(String const &other), this="<<this; std::cout<<", other="<<&other<<std::endl; return *this; } }; String const operator*(String const &lhs, String const &rhs) { String …

Member Avatar for stereomatching
0
172
Member Avatar for CrewAlien
Member Avatar for Smartflight
0
279
Member Avatar for Lensva

Code works, however i'm having problems with reverse string- i cant figure out how to index the elements. for cycle returns errors, what else could i use? The end goal would be to compare string line with string reverse. If adequate elements match its a palindrome. [code=c++] #include <iostream> #include …

Member Avatar for rohitvipin
0
2K
Member Avatar for cl2020

I have a palindrome set up in the system, and running fine. However, when I type "never odd or even" or "A Man, A Plan, A Canal, Panama", it didn't run properly as if these words in quotation marks are considered palindromes. Where is the loophole on my code re: …

Member Avatar for youjean
0
332
Member Avatar for adesh.soni

I have a problem to test endiness of c++ code . It contain around 170 files. How to check that whole code is bi-endian ?

0
43
Member Avatar for sharathg.satya

I saw this example while i am searching about vectors.. [CODE] vector<double> student_marks; // no size specified: vector contains // no elements int num_students; cout << "Number of students: " << flush; cin >> num_students; student_marks.resize (num_students); for (vector<double>::size_type i = 0; i < num_students; i++) { cout << "Enter …

Member Avatar for sharathg.satya
0
111
Member Avatar for jonnyboy12

Hello all. I have a question with no code because i'm a beginner at mfc and find it very confusing. I can see that there is a message loop in mfc. From what i understand it is like an event in windows form applications. In my mfc application i want …

Member Avatar for Ancient Dragon
0
177
Member Avatar for triumphost

The below code is what I have.. It's a custom type I made called Points that stores co-ordinates on the screen.. The problem is in the PointsArray Struct. When I declare one like so: [CODE] PointArray P; Point A(10, 5); for (int I = 0; I < 5; I++) { …

Member Avatar for triumphost
0
245
Member Avatar for SaimaAsif

Please help me its urgent... I have a MSDN Queue class, I need your suggestion can I make a message class and enqueue its objects as an element. [CODE]// new.cpp : main project file. #include "stdafx.h" #include "message.h" using namespace System; using namespace System::Collections; void PrintValues( IEnumerable^ myCollection ); void …

Member Avatar for SaimaAsif
0
229
Member Avatar for hekri

I'm an absolute c++ beginner so please be patient. [CODE]#include <iostream> using namespace std; double array_of_5[5] = {1,2,3,4,5}; double sum(double a , double b ); double a= array_of_5[2]; double b= array_of_5[2]; int main () { cout<<"The sum of two members of the array is: " <<sum<< endl; return 0; } …

Member Avatar for hekri
-1
262
Member Avatar for N.M.VIVEK

Hi every one this is vivek.I want a projent in oops which should be different it should be totally object oriented and i am getting confused what to do for my project.Please its urgent.Please give me some idea note:- only c++ should be used for coding

Member Avatar for thines01
0
122
Member Avatar for ifrah qaisar

Read 10 numbers in an array. Each number must be between 10 and 100. As each number is read, print it only if it is not a duplicate of a number already entered.

Member Avatar for deceptikon
-1
44
Member Avatar for sharathg.satya

i saw that we should not use the combination of new operator and free for allocating and deallocating memory in c++.. Is this right? is there any reason other than saying that the combination is calloc/free and new/delete? please help me.. thanks in advance

Member Avatar for deceptikon
0
177
Member Avatar for Karkalash

Hiya: I have tried to reproduce this equation to simple reflect a ball after colliding with a paddle (or screen bounds) R = V – (2 * V[dot]N) N I don't want to take the easy rout of just negating the velocity but is my first time trying to implement …

Member Avatar for Karkalash
0
556
Member Avatar for ahoysailor

Hi, I'm having a problem with taking the user input from a richtextbox in Unicode and writing it to a Unicode text file. I'm able to read a different Unicode file and write it to the new file, but when it comes to writing the contents of the richtextbox to …

Member Avatar for ahoysailor
0
260
Member Avatar for zerohero

Hello I'm new here and I've been up two night's trying to figure out how to write a program that will convert numbers to word. If anyone can help please respond to the post. here is what I sort of figured out so far. As you can tell I'm still …

Member Avatar for Kalel Kristoff
0
805

The End.