Beginners - March 2012 (Page 62)

Constructor Assignment List
 
When creating a constructor for some class, it has been advised to use an assignment list to initialize the member variables. This I think I understand, althou...
[2 replies] Last: foo() : m_var1( T1() ), m_var2( T2() ) {} // how to address t... (by thephysicsguru)
by xsemel
problem with file.get() function
 
for some reason "file.get () >> char ran;" isn't working. the getline(file, string ran) works fine, but it wont work for a single character. char grid ; ...
[3 replies] Last: http://www.cplusplus.com/reference/iostream/istream/get/ int get(); ... (by Moschops)
Trouble Creating a Linked List of Objects
 
Hello, my assignment is to create a linked list of pointers to objects (in this case the 'video' class). I understand how to use linked lists for integers, but ...
[1 reply] : If you haven't figured this out yet, I hope you see this before the as... (by lkjhg)
erasing a line...
 
I am trying to erase a number before "Magic Date", how do I do that? how come it doesn't work for "not Magic Date". #include <cstdlib> #include <iostre...
[6 replies] Last: Cheers! thank you. (by closed account zT7X92yv)
by Eyes
Adding Graphics and Animations in C++
 
Hi guys, I recently bought the book 'Beginning C++ through game programming' and I'm wondering if I'm missing something. Basically, it seems the whole book ...
[6 replies] Last: Yeh ok, thanks roberts :) (by Eyes)
Help Flowcharting a Switch and case statement
 
Ok, I think I know how to flowchart this but an example would help out alot. switch (membershipType) { case 'S' : membershipType = toupper(membershipT...
[1 reply] : There really isn't much of a point in drawing a flowchart, but you can... (by hanst99)
by swm93
Undefined Arguments
 
Hi there, I'm new to this forum and new to C++ programming and I've come across a problem. I have a function that receives values for its arguments from an ar...
[2 replies] Last: Bench82 , in Russia people usually says that it is better one time t... (by vlad from moscow)
by atjm88
Even Number?
 
Hi, I'm doing the even number checking, but somehow the code does't work, can I know which part I did wrong? TQ... #include <iostream> #include <conio> ...
[18 replies] Last: I made a typo. But as for you you should switch on your brain. I am no... (by vlad from moscow)
using exception on switch case
 
I get an infinite loop if i enter a char/string during the switch statement, so i made an exception to catch anything other then integers (line 155). But, i sti...
[3 replies] Last: Nevermind i got the if(!(cin >> choice)) way to work. thank you for ... (by fishsticks00)
STL Map help
 
Hey can anyone explain this because I am completely lost on what my teacher wants us to do for a map. We are doing a madlib type project. I have sent him a emai...
[1 reply] : Perhaps I'm not understanding you, but why can't you prompt the user a... (by Bench82)
by sdc30
Conversion from string to int
 
Hi, what I'm trying to accomplish is calling a function with a string and then taking that string and turning it into an integer. The way I could think of doing...
[6 replies] Last: @hanst99 Yeah lol its definitely not perfected its only my second seme... (by sdc30)
Using multimap to display elements with same key
 
I've created a multimap container where some keys are associated with more than one element. I've tested that some keys have more than 1 element with count and ...
[1 reply] : See the multimap example at: http://www.yolinux.com/TUTORIALS/CppStlMu... (by JLBorges)
by Ken777
A number between 10 to 100 randomly
 
#include <iostream> #include <ctime> using namespace std; int main () { int i,j; srand ( (unsigned)time( NULL ) ); //Display 1 random number for...
[6 replies] Last: Thanks for that ave working perfect now. (by Ken777)
Operator Overloading
 
I was trying to follow(trace) various function invocations using the below program: #include <iostream> #include <cstring> using namespace std; cla...
[6 replies] Last: oops..I read it as CC and thats why the confusion. (by dolphin spa)
by moot1
order of operations
 
does c++ know order of operations i want to make this calculator be able to use more than one operation in a math problem.how do i do that? #include <iostre...
[1 reply] : C++, standard libraries aside, only knows as much as you do. If you wa... (by hamsterman)
by ojima
Undeclared variable
 
Hello everybody, I'm currently working on a simple ASCII-game in the console, and I've stumbled upon a problem while making a class for a "monster". To explai...
[1 reply] : you give this error because you declare the 'cView' and the others var... (by Vins3Xtreme)
by Ch1156
Find and replace (1,2)
 
Hi im working on a program that lets the user input whatever they want and then the program finds the instance of a certain word, in this case "shit" and replac...
[30 replies] Last: I wouldn't worry too much about changing 10 or 15 words since you stil... (by cire)
Arrays
 
i seem to have forgotten my c++ basics Heres the problem: Using the following data type #define MaxMonth 10 typedef struct { char Month ; int days ...
[1 reply] : So, what's the question? (by roberts)
c-string
 
can we change a c-string or extract integers from a c-string? if yes then how?/
[2 replies] Last: I can't understand what you mean by changing a c-string. To extract i... (by eklavya sharma 2)
by Barkin
Please I need in 4 hours!! which part is missing? (1,2)
 
Output a prompt using the cerr object that instructs the user to type in a temperature in °F (i.e. Fahrenheit). Write code that converts the Fahrenheit tem...
[28 replies] Last: I think you need to make a new thread instead of recycling this old on... (by cire)
March 2012 Pages: 1... 6061626364... 71
  Archived months: [feb2012] [apr2012]

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