49,761 Topics

Member Avatar for
Member Avatar for dmoneyrpyt

# I have tried about a million times to fix the error but still no result and I need to fix this before tomarrow can someone help by showing me what to do the compiler shows that the error is at the curly braces after void triangle(int a, int b, …

Member Avatar for zeroliken
0
965
Member Avatar for cplusfreak

#include<iostream> int add(int a, int b) { int sum; sum=a+b; return sum; } int sub(int a, int b) { int sub; sub=a-b; return sub; } int mul(int a, int b) { int mul; mul=a*b; return mul; } float div(float a, float b) { float div; if (b==0) { return 0; …

Member Avatar for thines01
0
156
Member Avatar for maha khaled

Hi, i'am try to read postfix expression from txt file and evaluate it the input is "10 5 *" ,the output should be 50, but it shows -43 , where's the error ? here's my code #include <iostream> #include <iomanip> #include <fstream> #include<stdio.h> #include<ctype.h> #include<stdlib.h> using namespace std; #define SIZE …

0
109
Member Avatar for N1GHTS

I am importing some C code into a C++ compiler, specifically Borland C++ Builder 5. I seem to have a problem with this style of code: // A structure that contain's itself typedef struct AnObject AnObject; struct AnObject { AnObject *Object; }; // A global structure to store a pointer …

Member Avatar for N1GHTS
0
240
Member Avatar for pendo826

There's something wrong with the curly brace's can anyone see where please. //****************************************************************************************** //Header file for LinkedList.cpp. //****************************************************************************************** #ifndef LINKEDLIST_H #define LINKEDLIST_H //****************************************************************************************** //Declaring templates for classes. //****************************************************************************************** template<class Datatype> class LinkedListNode; template<class Datatype> class LinkedList; template<class Datatype> class LinkedListIterator; //****************************************************************************************** //Class: LinkedListNode. //Description: This is a class for the …

Member Avatar for TrustyTony
0
398
Member Avatar for noorah

Write a C++ program that asks the user to enter an integer n followed by n numbers. The program will use 2 stacks to enter the numbers entered by the user. In every iteration the program will balance the total of the numbers stored in every stack. For example, if …

Member Avatar for Lerner
0
231
Member Avatar for benclifford

Hi, I have a problem when trying to compile a program in C++ on linux using g++. **smurfVillage.h** #ifndef smurfVillage_H #define smurfVillage_H class Creature { private: char gender; int age; char species; public: Creature(); //parameterless default constructor Creature(char,int,char); ~Creature(); char getGender(); int getAge(); char getSpecies(); char setGender(char); int setAge(int); char …

Member Avatar for Lerner
0
359
Member Avatar for weeziefoo

I am a CS1 student and have had no issues until this point in the class really. I have been working on this for awhile now and cannot figure out how to get this to work! I am supposed to use this code and modify it to #1 - open …

Member Avatar for weeziefoo
0
605
Member Avatar for Shifter12345

Hello! I started learning C++ and I just discovered pointers. Well, it's a little bit hard for me to understand what's the point of it so I'll just explain my problem. I want to create a code in which I compute results using arithmetic operations (+, -, ÷, ×,%, ^ …

Member Avatar for devninja
0
185
Member Avatar for majorawsome

I am using Code::Blocks as my IDE and I am creating a text based game (Not very complex as I am just starting out with c++). As I proceed through this project I have found it more orderly to have multiple cpp files within a folder that relate(like two cpp …

Member Avatar for majorawsome
0
179
Member Avatar for Jakjakjak

I am in an Intro to Computing class and I have been doing fairly well but this program really has me stumped. This is our assignment: The program will take as input a worker’s first name, last name, ID number (four digit number), and unit production numbers for the last …

Member Avatar for Jakjakjak
0
2K
Member Avatar for n4j

hello everyone i have a large text file (about 5 GB) and with a program i should edit it with given information by user. when i use ordinary c++ functions related to files, it gives me error for that large file, however it works properly for a small text file. …

Member Avatar for n4j
0
111
Member Avatar for chaoz014

Im having a lot of trouble figuring out whta's wrong in my code... it compiles and everything but every time I try to run the program it crashes before even starting and displays the following message: Debug Assertion Failed! Program: c:\CIS 278\MyString\Debug\MyString.exe File: f:\\dd\vctools\crt_bld\self_x86\crt\src\dbgdel.cpp Line: 52 Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse) For information.......... …

Member Avatar for deceptikon
0
1K
Member Avatar for Vasthor

Hey guys, probably no programming for a long time (around 3 days), I lost myself on this, the `dent_space1(max_space1, ' ')` just not compiling, for its format. if so, how can I 'delete space' for the sake of this task? 4-2. Write a program to calculate the squares of int …

Member Avatar for deceptikon
0
190
Member Avatar for triumphost

How can I stop a process cleanly given it's name? I can use TerminateProcess but it says it does not allow the application to clean up and of course I want it to clean up. This application does not have a WM_CLOSE or WM_QUIT.. I tried.. and I cannot send …

Member Avatar for deceptikon
0
80
Member Avatar for marino07

i have to make a two players snake and ladder game in c++, in which i have to display the board aswell. i donot know should i use set(w) statment and cout my board or should i go for arrays? n if i do it using arrays, how to show …

Member Avatar for marino07
0
268
Member Avatar for pendo826

Hey i keep gettin syntax errors with my header file can someone please help me. //****************************************************************************************** //Header file for LinkedList.cpp. //****************************************************************************************** #ifndef LINKEDLIST_H #define LINKEDLIST_H //****************************************************************************************** //Declaring templates for classes. //****************************************************************************************** template<class Datatype> class LinkedListNode; template<class Datatype> class LinkedList; template<class Datatype> class LinkedListIterator; //****************************************************************************************** //Class: LinkedListNode. //Description: This is a …

Member Avatar for majorawsome
0
387
Member Avatar for samytaqq

Write a C++ program that asks the user to enter an integer n followed by n numbers. The program will use 2 stacks to enter the numbers entered by the user. In every iteration the program will balance the total of the numbers stored in every stack. For example, if …

Member Avatar for m4ster_r0shi
0
136
Member Avatar for ChaseRLewis

Whole purpose of learning C++ over C# and whatnot is for performance and working at a lower level for more control. Since I've been learning a little SIMD I figured a good project to test myself and make stuff better would be to program a basic scripting language that handles …

Member Avatar for mike_2000_17
0
190
Member Avatar for swissknife007

I am designing my own algorithm to check if 2 codes are similar or identical? How do pre-exsting softwares do this? What logic do they use? Are there different levels of testing for this? please give detailed answers

Member Avatar for ravenous
0
244
Member Avatar for hawkeyeviewonu

Sorry for my english.. Im trying to make a program that show the shortest route of this nodes using BFS algorithm.. ![115](/attachments/large/3/115.JPG "115") i tried to print the prev array which shows the shortest route but somehow it doesnt appear on console when running.. how to fix it? btw, is …

Member Avatar for histrungalot
0
982
Member Avatar for samytaqq

Let us suppose that we have 3 books (see table below), each of which contains a number of chapters and every chapter contains a number of sections. For example the book Data Structure contains 3 chapters (Queues and Stacks, Linked‐Lists, Sorting) and the chapter Queues and Stacks contains 2 sections …

Member Avatar for thines01
0
190
Member Avatar for butler273

So from the title. I'm still pretty wonky on the limitations of file streams. However is the following possible, given ofstream myfile; myfile.open ("example.txt"); while(int i=0; i<1000;i++){ functionfoo(i); } myfile.close(); and inside functionfoo we have myfile << object_1; //some other computations, essentially a placeholder or should I open and close …

Member Avatar for Ancient Dragon
0
123
Member Avatar for MrEARTHSHAcKER

Hi, I have been playing around with pointers and made a little mistake of this type: class D{ public: int a; }; int main() { D *x; //As you can see I didn't allocate memory at all... x->a=3; // ... but initialized a member variable cout<<x->a<<endl; return EXIT_SUCCESS; } I …

Member Avatar for JasonHippy
0
230
Member Avatar for Jorox03

I am trying to modify some code that was written in lecture to develop a program that simulates rgrep. The aim of the project is to search a directory's files for a string and output the line it occured on. The problem I'm having is I'm not sure what to …

Member Avatar for Jorox03
0
391
Member Avatar for wilintec

Hello, my question is this. In C++, how do i call a method member of class A from a class B, using a pointer. By the way Class A and B are of different types. I read that when a pointer is pointing to member function it can only point …

0
73
Member Avatar for T0pAz

How to convert this on CSharp? const char* data = "\x2D\x90\x01\x00\x00"; int version = 100; // is this 1.0? void* testAddress = (void*)0x4F77BB; if (memcmp(testAddress, data, 5))

Member Avatar for skatamatic
0
76
Member Avatar for triumphost

I have the following code which tracks the mouse movements on a control and if the mouse hovers it will beep. I want it to draw specific images on Hover and when it leaves, draw a different image. How can I accomplish this? I subclassed the buttons to figure out …

0
80
Member Avatar for stereomatching

I would like to study the source codes of openCV and reimplement them by the boost generic image library, I hope the algorithms developed by GIL could be integrated with Qt seamlessly. There are many libraries of image processing and I don't need to implement them again if I only …

Member Avatar for stereomatching
0
161
Member Avatar for tnavy99

Hey Everyone, I am including my current code. Can anyone give me advice on my middle function declaration? I rewrote this a few times and am now going on 12 hours spent on this one function alone! I am trying to just get it to display the last 10 lines …

Member Avatar for tnavy99
0
169

The End.