49,761 Topics
| |
# 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, … | |
#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; … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 (+, -, ÷, ×,%, ^ … | |
| 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 … |
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 … | |
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. … | |
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.......... … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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)) | |
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 … | |
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 … | |
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 … |
The End.