Beginners - March 2015 (Page 51)

How to get the index of an element into a vector most efficiently?
 
I found binary_search() in STL which will return true if an element equivalent to val is found, and false otherwise. But it doesn't return index. As I knew bina...
[1 reply] : Do you really need index? Why not use iterators? Also in your code po... (by MiiNiPaa)
Comparing numbers using for
 
Hey guys, how do you compare 5 numbers and print the biggest, only using for?
[1 reply] : you can store it in array. and make a variable temp. in the for loop.... (by xenovia12)
by Nis
Pointers inside class
 
Do you think I added the deconstructor, operator = and copy constructor correctly? #include <iostream> #include <string> using namespace std; class c...
[15 replies] Last: Why should I copy s? It's all declared in the same class :/ Think ab... (by Peter87)
Class called Date
 
I can't get my output to show the correct date, when I put in a date such as 10 10 1977 it shows 1/1/1977,January 1 1977, 1 January 1977 /*I will design...
[2 replies] Last: Hi, Nothing to do with your problem, but you shouldn't have to re-dec... (by TheIdeasMan)
Beginning Vectors/ need help with subtracting choices
 
Hello all!! So i'm learning c++. Im having an issue with vectors. I have an assignment that requires me to do the following. I have to have the user select 2 ...
[no replies]
by sivar
How to sorting through a file using C++
 
I need to sort the containig data following by the students average.. please help, I had 2 days working at it and i have no result! please help! Name: siva...
[10 replies] Last: struct method gives you more control, such as Calculating the Average ... (by anup30)
Resetting data type within a for loop
 
This mini program is suppose to produce all the possible words that are only one letter away from the string given by the user only seems to produce some of the...
[2 replies] Last: Thank you! Got it working! (by amikecallies)
C, C++, VC++/MFC/Win32, COM/DCOM FAQs
 
Hi All, Here are some questions and answers on C, C++, VC++/MFC/Win32, COM/DCOM for self study and interview preparation. http://www.equestionanswers.com/...
[no replies]
Question on arrays
 
So I've only just begun learning c++ and I was practicing me new learnt skills on some exercises, one of the exercises asked this question : "Write a progra...
[8 replies] Last: I think I got it now. Thanks for all the help everyone. This is what ... (by dude182)
making Fibonacci numbers
 
Here is what I'm suppose to do: By definition, the first two numbers in the Fibonacci sequence are 0 and 1, and each subsequent number is the sum of the previou...
[no replies]
Why isn't this simple program working?
 
This is a relatively simple program thats supposed to list all the perfect numbers up to 500, along with the count next to each number. But for some reason its ...
[7 replies] Last: make sure to hit solved button! good job! (by dagurr)
by dagurr
Program tweeking with arrays
 
What it does is ask the user to put numbers and then it will take the average. Hey so i was wondering how would i be able to tell the program ignore a users ...
[no replies]
by abc456
Can someone help me fix this code?
 
I'm supposed to write a program that tests the “randomness” of the C++ random number generator. Your program should generate 10,000 random numbers between 0...
[8 replies] Last: for(int i =0; i<100; i++) { temp+= numbers ; //c... (by abc456)
input only roman numerals
 
how do i program so that the user can only input roman Numerals(MXXL) #include <iostream> #include <string> #include <cctype> #include <iomanip> u...
[2 replies] Last: sorry but this doesn't really help me (by axel609)
by slappy
Recursive method that calculates a^b
 
Hey everyone! First time poster here. I need some help with a exercise I found in a test. The question might be very simple but its kinda hard for me, becous...
[16 replies] Last: keskiverto : You are indeed right, i just deleted my code from the fun... (by Precious roy)
by dagurr
Calendar Project (easy fix) (Slight error)
 
This works perfectly the only problem is the offset 6 is wrong and displays it not like it should. check it out and what do i need to do to fix this. #inc...
[1 reply] : I found several problems in the displayTable function. I'm not sure wh... (by closed account D80DSL3A)
What are these error codes on my prime test??
 
Hello all. I am currently learning C++ in college, and I need help with an assignment. I've been stuck on it for about 7 hours now :( primetest.cpp: In func...
[7 replies] Last: Simple Google search reveals: http://stackoverflow.com/questions/1452... (by Militie)
March 2015 Pages: 1... 495051
  Archived months: [feb2015] [apr2015]

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