Beginners - April 2015 (Page 47)

by Roody
what is wrong with my code ?
 
I want to Write a program that finds the summation of the following: X = 1 – 1/2 +1/4 -1/6 + ……… -1/18 + 1/20 #include <iostream> #include<co...
[5 replies] Last: it worked , thank you . (by Roody)
Ideas for a C++ project?
 
I am supposed to write a code in C++ as a project for school, however I have no idea what I should do. I need to have in the code at least: 3 functions 1 ar...
[2 replies] Last: A gradebook is a common project for such specifications. (1) Prompt... (by Aaron Vienneau)
by SCB3
having trouble using an array
 
So I've been doing a minesweeper game and managed to get to the point where I can play the game fully, but now I am trying to set it out so that when a player m...
[4 replies] Last: if (userchoice == 'd' && minesweeper ==mine||guesses==65) { c... (by SCB3)
by SAM012
nesting loops?
 
so I'm trying to create a code that follows these guidelines // create code so that 4 rectangular prisms are created. // the formula for the length of the...
[1 reply] : Please edit your code and use code tags otherwise its unreadable - htt... (by TarikNeaj)
Write a program that displays the first ten lines of a file
 
Write a program that asks the user for the name of a file. The program should display the first ten lines of the file on the screen. If the file has fewer than ...
[2 replies] Last: thank you. \ (by fermentingblob)
Why is it showing "error: void value not ignored as it ought to be" in my insert function of Binary Search Tree?
 
I've written the following implementation of Binary Search Tree: #include<iostream> using namespace std; struct Node { int Data; Node* Le...
[2 replies] Last: I've changed the function. Now it doesn't show any error. But after ru... (by abdalimran)
by ahhvb
Help reading files
 
My code is below. The file I am trying to open is Random.txt located in "C:\Users\Tony\Downloads". I have tried inputting "Random.txt" "C:\\Users\\Tony\\Downloa...
[13 replies] Last: On second thoughts... you should probably not use double backslashes (... (by Peter87)
Unknown size of vector
 
Hi, I have an application that require the use of OO using vectors. I am pretty new to classes so it is probably a simple a mistake but I cannot figure out ...
[1 reply] : Its becuase in you have Berth included in Rows, and Rows included in B... (by TarikNeaj)
by VVS
check out code error ?
 
I'm suppose to write a code that tests if the dimensions a user has entered equals a cube.. I thought it worked but now I'm testing it and its only working i...
[2 replies] Last: thank you! (by VVS)
by ebucna
Can't populate array with string
 
I get a: cannot convert '<brace-enclosed initializer list>' to 'std::string* {aka std::basic_string<char>*}' in assignment after trying to compile this: ...
[9 replies] Last: lol (by ebucna)
by VVS
++ -- expressions
 
so I'm trying to write a code that calculates the volume of a rectangular prism and I'm asking the user to input length, width and height. after this i'm sup...
[3 replies] Last: I just showed you how. Its the same... cout << "Enter width: \n"; ci... (by TarikNeaj)
by s8050
How to define a variable that might be a number or a word?
 
if an input might be either a number or a word, in case of a number it's value should be assigned to an int variable for mathematical operations. while in case ...
[2 replies] Last: that was so helpful! thank you very much :) (by s8050)
Some general advice
 
I'm a 15 year old who is struggling to learn C++ past declaring integers. I haven't got any access to tutors in my area and consequently the only way of learnin...
[2 replies] Last: Those uni assignments would help a lot, and the exercises look like th... (by Peggers)
Segmentation error! Plz help
 
Link to the problem: http://www.codechef.com/problems/LECANDY I was just desperate to use a recursive function though I've solved the problem already using a...
[12 replies] Last: > The answer to your problem is that you have not allocated memory for... (by ne555)
How to loop through a map of vectors?
 
Hello! I have a map of vectors (integer keys) and I want to be able to loop through the map AND also through each vector but I'm not sure how to start the vecto...
[3 replies] Last: Morning my friend, before giving you more of a hint, I have to let you... (by ultifinitus)
indefinite matrix
 
hi, i am still beginner and don't know how to use but c++ and i was wondering how can i make array that its order is entered by the user but i don't know how to...
[7 replies] Last: That's valid in C99, however unfortunately not everything in C is avai... (by Avilius)
If statements and conditionals.
 
Hello, I'm very much a newbie in C++; I'm following a course online and the current exercise is to make a console app that compares the length of two words and ...
[3 replies] Last: Debugging man. Debugging saves life. (by TarikNeaj)
Using "any_of" for string
 
Hello. How do I use this ( http://www.cplusplus.com/reference/algorithm/any_of/ ) function for string? I need to check if the string contains specific numbers.
[19 replies] Last: Ignore, the odd bits -- I did miss that square. On the cpp.sh: #incl... (by keskiverto)
by koopey
binary search insert function implementation
 
the insert function is from jumping into c++ but there is no example implementing it. plz see commented section in int main() #include <iostream> using...
[10 replies] Last: It's different when you're allocating new memory. #include <iostream... (by fg109)
Explain this please
 
Explain line 5 of the code please! struct studentRecord { int score; string* name; int operator != (studentRecord x) const { return (score!= x.sc...
[5 replies] Last: Yes a function is returned, you're returning an integer errm, o you ... (by tipaye)
April 2015 Pages: 1... 4546474849... 52
  Archived months: [mar2015] [may2015]

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