49,761 Topics
| |
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 … | |
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 … | |
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 … | |
#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 = … | |
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 … | |
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; … | |
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 … | |
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 … | |
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 ? | |
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 … | |
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 … | |
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 … | |
#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 … | |
## 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 - + - + - + … | |
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 … | |
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 … | |
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? | |
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 … | |
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 … | |
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 … | |
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. | |
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 … | |
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. … | |
#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 … | |
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 … | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.