Beginners - April 2015 (Page 49)

implicit and explicit operations
 
Hi, I'm having this question and i can't figure out the right answer What operations may be invoked implicitly for a class object So there are these 7 essent...
[no replies]
Display scores in rows of four
 
I have to display scores from array in a rows of four. But my code does not display properly. So, I need help to fix it. This is my code: #include <ios...
[2 replies] Last: Works perfect. Thank you for your help (by abcdefghijkl)
Need help with Beginner exercise(#2)
 
When i run program,and type in what beverage do i want,it just terminates program #include<iostream> using namespace std; char ch; int main(){ co...
[2 replies] Last: #include<iostream> using namespace std; int main(){ cout<<"Hello! ... (by patriic48)
What is the modular multiplicative inverse of the equation in C++?
 
Given equation: Result=(m*(1-pow(m,l))) / (1-m); Result should be printed of modulo 1000000007 What will be the modular multiplicative inverse of the equ...
[no replies]
by Googol
Array of structs accessed with a pointer
 
I need to create an array of structs but cannot seem to get past the declaration. I would like to keep the struct and the array pointer in private in the header...
[no replies]
What is constexpr?
 
What is the use for constexpr and how does it differentiate from const. It says something like it gets called during compile time or something like that but I d...
[3 replies] Last: const just means you are not allowed to modify something. constexpr sa... (by Peter87)
Scanning whole program
 
I'm trying to program death into my text-based RPG game, and it would be much easier to be able to use something like "death = 1" and just have it like that. I ...
[10 replies] Last: that's working for me, 100% (by MikeTheFish)
Variable with multiple data types
 
Hello All. So guys i am making a program for my assignment. Now in the code i want to use a variable which is a multiple data type variable. What i mean to s...
[3 replies] Last: Look into unions. http://www.cplusplus.com/doc/tutorial/other_data_ty... (by fg109)
input validation
 
Hi, I need help with my code, I should create a function that gets input from the user for 3 different pizza sizes (in inches), and their price accordingly. I ...
[10 replies] Last: That was a great point! Thank you. while ((!(small >= 5) || !(small ... (by khatereh)
sorting eigenvalues problem
 
Hello, I have a program, which returns eigenvalues and eigenvectors in form d and A . After getting the values, I need to sort them by increasing value. I fo...
[9 replies] Last: > the sorting algorithm instead of sorted eigenvalues, > returns exp... (by ne555)
How do I check if the sum of the numbers of 1st half and 2nd half of an array is same?
 
Given an array of even size. I have to determine if sum of any combination of the numbers (half of the size) is equal to sum for other half numbers of the array...
[1 reply] : http://www.cplusplus.com/doc/tutorial/arrays/ Video 32-34: https://ww... (by TarikNeaj)
by Gsnore
Writing the complete program
 
I started this program and i am completely lost with it. If anyone can help me it would be very appreciated. This is the information i have: Background: Thir...
[3 replies] Last: Because I found the problem description amusing, I'm going to suggest ... (by fg109)
by xmyant
help on void add and void delete function
 
Erm.tis coding still havent completed.I have stucked in void add_new and void delete.Anyone can help? #include<iostream> #include<conio.h> #include <cstrin...
[2 replies] Last: To repeat what Butch said but in a non-cryptic way. Please edit your... (by TarikNeaj)
Segfault (Segmentation fault) for no reason (1,2,3,4)
 
Whenever I add a new variable to a specific external header my program crashes. I debugged using GBD/CBD debugger from Code::Blocks , and it says: SIGSEGV(Segme...
[65 replies] Last: I've redone the whole game from scratch , using vectors and not only t... (by Funkist)
Why not initialize your variables?
 
So, I read a lot of professionally published books and articles with code examples that don't initialize their variables. Personally, I see no downside to alwa...
[4 replies] Last: Right. OK. This makes sense. It seems like the answer is: It's prefere... (by Aaron Vienneau)
by lew13
Need a little help debugging
 
I get an error at line 23: A function-definition is not allowed before "{" token, and I don't understand why this is illegal. The other error I get is on line 3...
[4 replies] Last: Either define the function before main or announce them in the top and... (by It3rat0r)
a program that prints input in different positions.
 
Write a program that asks a user to enter his/her first name, last name and the marks of three tests (out of a 100), and then the program prints to the screen t...
[1 reply] : http://www.cplusplus.com/reference/iomanip/setprecision/ http://www.cp... (by closed account SECMoG1T)
if else statement basic problem
 
This program keep on having 'else' without a previous 'if'. What is the problem exactly? #include <iostream> #include<string> using namespace std; ...
[2 replies] Last: as long as your if statement consists of more than one line, for examp... (by shahd95)
Problem giving an object another object / joust game
 
I am writing a jousting game for my 111 class and am having trouble figuring out why my Knight object/class wont recognize my weapon object/class. //knig...
[3 replies] Last: At line 71 of your OP, you have: Knight userKnight(string name, int ... (by MikeyBoy)
April 2015 Pages: 1... 474849505152
  Archived months: [mar2015] [may2015]

This is an archived page. To post a new message, go to the current page.