49,761 Topics

Member Avatar for
Member Avatar for VernonDozier

I am looking for a portable method of checking whether overflow has occurred when multiplying unsigned integers. The way I have always done it in the past is to turn my unsigned integers into uint64_t's, multiply, then create a uint64_t with a value of 2 to the 32nd power and …

Member Avatar for deceptikon
0
173
Member Avatar for rfrapp

I'm writing maze traversal for a school assignment, and I've got an issue. The X will move through most of the maze, but then it will get stuck at a position and keep cycling through. This is probably because I'm not checking properly to see if it hasn't been to …

Member Avatar for rfrapp
0
910
Member Avatar for eric.i.perez

1.Make and run a program that will output all the prime numbers from 1-100. (FN do prime) 2.make and run a program that will allow the user to input 10 numbers and display the total number of positive and negative numbers entered. 3. write a program that reads numbers until …

Member Avatar for NathanOliver
0
140
Member Avatar for nUmbdA

#include <iostream> using namespace std; int main() { //declare variables const double FEE = 10.00; double total_fee, charges, checks; //display header information cout << "Chapter 4 Homework\n\n"; //request input from user cout << "Enter number of checks written this month "; cin >> checks; cout << "\n"; if (checks = …

Member Avatar for nUmbdA
0
152
Member Avatar for A Haunted Army

i'm having a bit of a problem getting my collision handler to work correctly, my collision detection works fine but handling the movement after the collision is where things have gone a bit buggy. the idea is that if the object is colliding horizontally it will be moved back before …

0
78
Member Avatar for ConfusedLearner

I am trying to get my program to run when I input two integer numbers in the subroutine, and then do the following math (x+y)/5. Dont know where I am going wrong. #include<iostream> using namespace std; int Divide(int X,int Y); int main() { int X; int Y; cout<<"first number:"; cin>>X; …

Member Avatar for mrnutty
0
125
Member Avatar for Suzie999

background. I usually test my code in both debug and release mode each time I make changes, but forgot for half a day and now I have errors. I had gotten carried away thinking I was in the zone, and left it in release mode, when I realized and tried …

0
74
Member Avatar for dospy

first of all, sorry if this thread is in the wrong section, but i think this is the most appropiate one i need clear instructions for installing AND configuring QT for my machine(i am running windows 7 on 64bit) i don't want other reference links unless they perfectly suit my …

Member Avatar for dospy
0
131
Member Avatar for Jennifer84

I have a question of how it would be possible to change the IP address to a randomly new IP address. How would I go about to do this ?

Member Avatar for rubberman
0
290
Member Avatar for sandheer.sannidhya

Dear all, i am soon entering 11th grade and will be studying c++ in full length. I want to learn another language to compliment it which can provide me the freedom to over a variety of devices and paltforms. I have chosen asm(assembly) as i think it very basic to …

Member Avatar for rubberman
0
239
Member Avatar for mc3330418

I have three funcitons that all have arrays. I need to make a print function. Here is one of the functions. void findUpperCase() { infile.open("trytext.txt"); int count = 0; char letters[MAX_LETTERS]; int upperLetters[26] = {0}; while ( infile.peek() !=EOF ) { infile >> letters[count]; count++; } infile.close(); for ( int …

Member Avatar for rubberman
0
134
Member Avatar for Dman01

Hi guys. I want to write a keylogger which logs all strings I copy via <CTRL>+<C> My problem is that I loose track of interessting links or code-snippets when overdoing it. So I want a basic keylogger which notices every hotkey event and copies the content in the clipboard into …

Member Avatar for dospy
0
224
Member Avatar for dachy12

#include<iostream> #include<string> using namespace std; class student { public: void input(string name, long id, int grade1, int grade2, int grade3); void GPA(float) const; void Display() const; private: string name; int id; int grade1; int grade2; int grade3; }; int main() { string name; int id; int grade1,grade2,grade3; float gradepoint; student …

Member Avatar for dachy12
0
121
Member Avatar for mrnutty

## I know we haven't been doing much of these C++ Community problems so I though I'd write one up to get it started once again.## **Problem Statement:** For some integer `v,w,x,y,z` find all solution to the following equation 1 1 1 1 1 - + - + - + …

Member Avatar for mrnutty
0
114
Member Avatar for Huxaifa

int main() { float a,b,c; cin>>a >> b >>c; if(a<(b+c) && b < (a+c) && c< (a+b)) { cout<<"\nIt is a Triangle.”; if (a==b && b==c) cout<<"\nIt is a Equiletaral Triangle.”; if(a==b || a==c || b==c) cout<<"\nIt is a Isoceles Triangle.”; else cout<<"\nIt is a Scalene Triangle.”; } else cout<<"This …

Member Avatar for DEAD TERMINATOR
-1
363
Member Avatar for rikkie

Hi, I am trying to calculate the distance between two points, by using Pythagorean Theorem and the x,y coordinates of two points. However, I have the following issue in line 14: "*Expression must have integral or enum type*". #include <iostream> #include <math.h> using namespace std; int main () { float …

Member Avatar for phorce
0
2K
Member Avatar for idlackage

I have this code: sigc::connection conns[4]; And I get this error: Program received signal SIGSEGV, Segmentation fault. 0x00f4b620 in g_type_check_instance_is_a () What does this mean?

Member Avatar for ram619
0
49
Member Avatar for ace8957

Hi all, So I'm trying to learn how to do a hash table with separate chaining, but it is giving me several issues. The hash table I'm trying to make will hold instances of a class named Person and uses Person's data member phonenumber for the key. Currently, the main …

Member Avatar for deceptikon
0
4K
Member Avatar for fugnut

Hello all, I am working with a program to calculate the days in a given month. We are to use functions and bool. I have the below code, which worked until I tried to create the function. I continue to get an error about "numberOfDays" not being initialized however if …

Member Avatar for deceptikon
0
3K
Member Avatar for andigirlsc

I am trying to print out a report for a 12 month interest summary. So far, I cannot seem to get the ending balance for the previous month to be the starting balance for the next month. Here is the code I have so far: #include <iostream> #include <string> #include …

Member Avatar for Moschops
0
221
Member Avatar for vasuv

Hi all, I am planning to design mibile app using c,c++ if possible.can any one please suggest me how to design it if possible. Please your thoughts regarding this and appreciate your suggestions. Thanks, Va.

Member Avatar for myk45
0
172
Member Avatar for sarah.mathieson.7

I am trying to use the ncurses menu library to create a menu. I found some wonderful sample code online and it displays great on my screen, however I can't figure out how to select an option and have it go to a new menu or have it select a …

Member Avatar for Ancient Dragon
0
218
Member Avatar for numbplum

Hey guy I'm wondering if there is a tutorial or example code for a C++ RPG inventory system. I've surfed the website and I only discovered to make two classes, item and inventory and to use each of them for item's detail and holding the items in a linked list. …

Member Avatar for Ketsuekiame
0
1K
Member Avatar for silvera

#include<iostream.h> #include<fstream.h> #include<conio.h> #include<process.h> #include<stdio.h> #include<string.h> int access=0; // for accessing data modifier functions int report_s=0; int report_u=0; class element { int at_no; float mass_no; char name[15]; char symbol[4]; int group,period; //for displaying the table public: void input() { cout<<"enter elements name \n"; gets(name); cout<<"enter its symbol \n"; gets(symbol); cout<<"enter …

Member Avatar for Ketsuekiame
-2
215
Member Avatar for some

Hello everyone, I was working on a program that was meant to open something the user put in. Basically, the user would put in the path and then the program would open whatever was there. I can't work it though, every time I put in the file path, it says …

Member Avatar for Lucaci Andrew
-1
223
Member Avatar for TheNotoriousWMB

I'm trying to write an algorithm for a larger project that will take two strings which are both large integers (only using 10 digit numbers for the sake of this demo) and add them together to produce a final string that accurately represents the sum of the two original strings. …

Member Avatar for Lucaci Andrew
0
171
Member Avatar for arcticman452

I am writing a program that calls the memory address of different variable types. I am having troubles with getting the address locations for my array and my char pointers. Here is what I have so far: #include <iostream> #include <string> using namespace std; int main() { const int NUMBER_LIST …

Member Avatar for arcticman452
0
151
Member Avatar for cucumalay

hi, this is my assignment and my code is below too. I don't know why it does not work. #include <iostream> #include <fstream> #include <string> #include <cstring> using namespace std; int main() { int const size=20; char word[20]; char dash[size]={" "}; char guess; int number = 6; int lives; int …

Member Avatar for NathanOliver
0
148
Member Avatar for Elixir42

I have written a working templated linked list that can hold a number of Types. Each of which are created with new before sending them to the InsertNode function. in Main: CMyType* pMyType1 = new CMyType; // Create a new MyType* pMyType1->m_iData = 5; // Hold a value LLMyTypes.InsertAtEnd(pMyType1); in …

Member Avatar for Elixir42
0
255
Member Avatar for erogol

How could I add a external library to the native c++ lirary path at Ubuntu to be found by #include from source code? I have some couple of sources that I try to include them by all the codes written on my machine thus instead of coping all the library …

Member Avatar for rubberman
0
6K

The End.