Beginners - January 2015

How to check if the user is entering the same input twice?
 
I have a simple program that asks the user to select 3 players from a list. Is there any way to keep the user from selecting the same player twice? I tried crea...
[4 replies] Last: I modified your solution and it works perfectly now. Thank you for you... (by sean244)
by GJOwl
Differing variable input question
 
Hi all, I'm working on an assignment where the user inputs the center coordinates(x,y) for an circular array of (x,y) points. The program performs some calc...
[no replies]
How do I round?
 
I've tried everything possible and the final answer won't round up. This is what I have so far and this is what it is telling me to do. "Enter pounds: 7 Ent...
[6 replies] Last: Can someone please help me? I've been struggling through this for hour... (by Giorgio)
Noob needs help with foo and other things
 
So I'm just picking up C++ in college and I'm really enjoying it. However my teacher is a backup who has never taught C++ before and only codes in C. >Had to ra...
[13 replies] Last: Thanks. I was just using it as an example because I only know of main ... (by TieRein)
by Felmon
help me pls, I am not quite sure if I am doing right or not.
 
Write a program in C++ that prompts the user to enter a number representing inches and breaks it down into inches, feet and yards. For example, if a user enters...
[no replies]
by KMagic
Memory leak detection
 
I have googled how to detect memory leak and knew that Microsoft offers a library which can help us with this problem. Is there any other way to do it by usin...
[1 reply] : Try Deleaker, it has standalone version that works with binaries made ... (by ArtemRazin)
Vector resize
 
Why does vector resize cause array entries to be zeroed out? #include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorith...
[2 replies] Last: resize is changing logical size of container. If new size is less than... (by MiiNiPaa)
by Ulutay
pow() function
 
hi, i have been trying to write the ready-made (cMath) pow function. #include<iostream> using namespace std; float pow(float,int); int main() { ...
[3 replies] Last: aha i got it now, thanks a lot, cheers ! (by Ulutay)
How to use new to allocate space?
 
I have no idea how to use new or what it means. I would appreciate it if someone can explain it to me in an easy to understand way since I am a beginner.
[6 replies] Last: Was a typo, but MiiniPaa is correct you should use delete with new a... (by Pindrought)
problem with pointers
 
this code works... int **p=new int* ; but can someone help me with the code below? int **p; *p = new int* ; ...
[3 replies] Last: Oh okay I've never worked with that. Also, don't forget that every ti... (by Pindrought)
not understand
 
Hi, i'm do a program about list , and a list that I do is this: placed alternating ends of the list where scores tasks , ie he takes the first task and inse...
[1 reply] : Actually inserting at the beginning is easier than inserting at the en... (by dhayden)
Basic C++ program
 
Write a program that asks the user to input 5 integers. For each integer, squaring it, print out the original integer that its square is not divisible by 4 and ...
[3 replies] Last: As dhayden stated, the optimal way to do this would be to use vectors,... (by Pindrought)
need help with code!
 
hi so im having some problem with my code so i think its because of the loops please check the code and tell me where i went wrong! #include <iostream> #...
[no replies]
Problem with function argument
 
If i have this class for fractions #include <iostream> #include <cstdlib> using namespace std; // Models a mathematical rational number class Rational...
[2 replies] Last: Thank you big time man, really helped me :) (by etrusks)
Please help me in Palindrome Code
 
Check if the string is a palindrome If a string is not a palindrome, at least how many cuts do you need to cut the string into palindromes ? #includ...
[2 replies] Last: yes, I forgot to edit sossanh ==> compare But I want you help me in s... (by locvx1234)
Creating bigint class
 
Hello, I'm working on a class project and we're creating a bigint class from scratch, and i'm having trouble with the last two functions. Instructions for e...
[7 replies] Last: dhayden - So, after digit iterates backwards through the array, the ... (by tmmobley)
Possible permutations of strings.
 
I am trying to solve a c++ problem in which at a point I need to find all the possible permutations of strings entered by the user. For example, the possible pe...
[1 reply] : what functions will be useful? std::next_permutation maybe? http:/... (by MiiNiPaa)
Does the release() member function of unique_ptr class free the memory of a dynamically allocated array?
 
According to my textbook, if a unique_ptr points, say 'unikp', to a dynamically allocated array, then after the user use release() member function on 'unikp', t...
[11 replies] Last: Okay, I get it. Profuse thanks to everyone. I really appreciate your h... (by glenjoker)
by h4ever
problems with pointers
 
I have problem with solving pointers. I a redesigning a function. In main() I have: struct jpeg_decompress_struct cinfo; Then the function: bool JPEG_pre...
[3 replies] Last: Last line which is crashing: (void) jpeg_finish_decompress(&*cDecompr... (by h4ever)
OUTPUT OF THE CONSTRUCTOR
 
FROM THIS SIMPLE CODE I WAS EXPECTING THE OUTPUT :: Constructors are automatically called Sum = 30 Constructors are automatically called Sum = 60 ***...
[1 reply] : Hi, The output is exactly as it laid out in the code. Code executes i... (by TheIdeasMan)
January 2015 Pages: 123... 39
  Archived months: [dec2014] [feb2015]

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