49,755 Topics

Member Avatar for
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
171
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
110
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
79
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
263
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
309
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
135
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
189
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
981
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
184
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
220
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
72
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
160
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
Member Avatar for easterbunny

Hi i got a problem with this code( attached below ) the fuction that receves the bidimensional array doesn't seem to work.I've tryed to cout in main() and it works.WHY???? The program doesn't show me any error whatsoever. #include<iostream> #include<string> #include<fstream> using namespace std; void afisare(int h[3][3],int nrEle){ for(int i …

Member Avatar for easterbunny
0
860
Member Avatar for cresenia1988

I'm currently doing an assignment and I would like to seek for help. I'm suppose to do a creation system where Option1: I would create a binary file(outfile.dat) from infile.txt. //below is the infile.txt F Indonesian Michael Chen F France Alain Pierre S Tan Eng Soon S Lee Ang Heng …

Member Avatar for mrnutty
0
192
Member Avatar for glen999

please help i'm stuck on something for a project i'm doing i need to display the numbers 1 to 9 randomly but they cannot be repeated! the code i have so far is this: #include <iostream> #include <ctime> #include <cstdlib> using namespace std; int main() { srand((unsigned)time(0)); int random_integer; int …

Member Avatar for deceptikon
0
157
Member Avatar for K33p3r

Good day, I have a college project in which I need to create a program which simulates an Erlang(k) variable. I am not talking about the Erlang language, it's about a standard Gamma(0,1,k), k ϵ N+. I appreciate if someone can help me out or give me advice on how …

Member Avatar for m4ster_r0shi
0
353
Member Avatar for jinglylime

Hi,I have encountered a problem while doing the animation for my program. I wanted keep adding a another shape on top of another. But for evry second image the background changes to black. Can you point out what I've done wrong. Thanks. #include <stdlib.h> #include <stdio.h> #include <time.h> #include <GL/glut.h> …

Member Avatar for emilo35
0
236
Member Avatar for annitaz

#include <QApplication> #include <QLabel> #include <QVBoxLayout> #include <QTextEdit> #include <QWidget> int main (int argc, char* argv[]) { QApplication app (argc, argv); QWidget window; QLabel* label = new QLabel("Please enter some text"); QTextEdit* textEdit = new QTextEdit; QVBoxLayout* layout = new QVBoxLayout; layout->addwidget(label); layout->addwidget(textEdit); window.setLayout(layout); window.show; return app.exec(); } 1.Qt provides …

0
117
Member Avatar for Sudha Granger

void doc::add_title() { doc d; fstream f; int med_lic,flag=0; char new_title[20]; cout<<"\n\t\t\tADD NEW DOCTOR TITLE\n"; cout<<"\nEnter the Doctor's medical license number :\t"; cin>>med_lic; f.open("doctors.da t", ios::binary|ios::in|ios::out); while(f.read((char*)&d,sizeof(doc))&&flag==0) { if(d.ret_med_no()==med_lic) //d is an object of class doc { cout<<"\nEnter the new title:\t";//ret_med_no() is an accessor function used to return a value …

Member Avatar for Sudha Granger
0
280
Member Avatar for hay123

This is my code so far: #include <iostream> #include <cmath> #include <cstdlib> using namespace std; int main() { float numbers[15]; float sum, lowest, highest; float min, max, range, stDev, mean, median; int indexOfMin; float above = 0, below = 0; sum = 0; for(int testNum = 0; testNum < 15; …

Member Avatar for histrungalot
0
244

The End.