Beginners - January 2015 (Page 2)

by shola
Nested Loop Problem. Help me to figure out how to do it
 
Modify the program in step 2 so that if the x-coordinate (the number of *'s you print on a line) for any line falls within the range 20 ≤ x ≤ 30 then onl...
[3 replies] Last: Line 32 - 34 is saying the following If the # of stars to be printed ... (by closed account 2UD8vCM9)
how to change date and time to int
 
I need to change a date and time from a .txt file in the form of str, then divide it in terms of year, month, day, hours, minutes and seconds, then turn them al...
[no replies]
by Sh0es
Proper way to Overload operator<<
 
I've tried numerous ways of overloading operator<< for numerous classes, but I always seem to get some sort of compiler error. I try: template <class T> std:...
[8 replies] Last: It shouldn't be a member function. You want something like this: clas... (by dhayden)
Adding input into existing integer variable
 
What I am trying to do is add an integer from 'cin' into an already defined integer variable. I feel like there is a very simple answer to this question, but I ...
[1 reply] : I believe you need a second integer. (by closed account 2UD8vCM9)
Error in array pointers? REPLY FAST!!!!!
 
I am building an advanced calculator program and I am getting errors on line 22 when I compile the following code. Main.cpp (no error) #include <iostream> ...
[4 replies] Last: You don't do a pointer declaration at all. Just #include <vector> ... (by closed account 2UD8vCM9)
Advantages to using array vs declaring multiple variables?
 
I'm just curious what the actual advantage is to holding variables in an array versus declaring several variables. It seems to me that the two are virtually the...
[1 reply] : It stores them in memory exactly the same way. However, think of this ... (by closed account 2UD8vCM9)
Converting from miles to kilometers
 
hey guys , i started to learn programming from a book called c++ principles by the creator of the language in the exercises he wanted a program to convert from ...
[6 replies] Last: @Pindrought , yes i got it now thanks so much for your time man. (by Zamalek)
Reverse Guess my number.
 
I have a full code of the game, I just can't seem to get my algorithm to work, I have looked around the web for an algorithm that could possibly work. I can' fi...
[3 replies] Last: Also you use do{} whithout while . It should be do{}while(some_boo... (by TheHardew)
Nested Classes, Operator Overloading and Sorting
 
Was randomly practicing some techniques I felt like putting together. Nothing to brag, but it was fun :). P.S It compiles just fine. #include <iostream> #inc...
[1 reply] : Cool (by TheToaster)
by MrFrog
Functions problem
 
Hi there, how do i get this function to draw a sine wave: double y, x, Pi, TwoPi; HDC hDC; Pi = 3.14159; TwoPi = 6.28318; for(x=0; x < ...
[9 replies] Last: How do i add this library to my project in dev c++?? (by MrFrog)
by T4l0n
cannot go thought linked list in hash function
 
line 28 does not work, i cannot go thought the linked list to the NULL and create new data static int const size = 10; struct Item{ string name; ...
[2 replies] Last: thanks a lot (by T4l0n)
2D Arrays
 
Can anyone help me to simplify or make this code better? I feel as if i made it unnecessarily long. #include <iostream> using namespace std; int main(...
[3 replies] Last: You could try making a nested for loop after you initialize your array... (by HatchetMan302)
"variable generator"
 
Is there any way for a new variable (not a value for a variable) to be made each time a loop is run. Like cin >> t1 cin >> t2 cin >> t3 . . . cin t1000...
[3 replies] Last: You can also use dynamically alocated arrays. realloc() would be helpf... (by TheHardew)
Menu Function Code check
 
Don't have access to a compiler today to test my code and asking someone to look this code over for errors or improvement areas. Basically I have written a part...
[1 reply] : Well first off, in your prototype for the menu function you are saying... (by HatchetMan302)
How to read vectors
 
How do I take a vector such as: < (2,c) (4,T) (3,R) > and print out a dynamic array such as this: 0---C 1---C 2---T 3---T 4---T 5---T 6---R 7---R 8---R Just ...
[7 replies] Last: try this. http://cpp.sh/4emo (by rafae11)
Is this a good book?
 
I was wondering if this was a good book to learn C++ from. -AL Stevens C++ Programming 7th Edition.
[2 replies] Last: Right, thank you :) (by Wulfinite)
by KMagic
Linked list
 
I have been learning about linked list. In an example, there is a piece of code that defines the ListNote struct like this: struct ListNode { double val...
[1 reply] : That is a hangup from C, C++ accepts your second example but C doesn't... (by Jaybob66)
basic input output related query
 
Hi, i have to show output like this, while taking input in one turn like shown here. please provide me some suggestions,The code i have written works but it tak...
[1 reply] : http://cpp.sh/2bvr (by rafae11)
When to use break inside a forloop
 
I'm having a hard time grasping the use of break inside a loop. I know that in switch cases, the objective to tell the compiler to not get into that case. Now ...
[3 replies] Last: Makes lots of sense. Thanks! (by sheva29)
by NLB
Help for a true beginner?
 
Hi! I'm new to the forums and C++ in itself, but I am taking a class for it on the side and I just cannot seem to grasp this one linear search program. I feel l...
[2 replies] Last: Sadly I do not, I will read about them and see what I can learn, thank... (by NLB)
January 2015 Pages: 1234... 39
  Archived months: [dec2014] [feb2015]

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