Beginners - October 2012 (Page 34)

by am0n
Why isn't this code working?
 
Hello, I'd like to know why is this not working #include <iostream> using namespace std; int main() { double mark; cout<<"Ente...
[7 replies] Last: I understand, Thanks I'll keep that system thing in mind too. (by am0n)
declaring a variable
 
i am a little confused with the difference between declaring & defining a variable and a function int x; is supposed to be defining a variable whereas exter...
[3 replies] Last: You're question about variables: declaring a variable tells the compi... (by Fovv)
Implementation with function parameter packs
 
I don't understand how can implement this functionality with variadic templates. I don't understand if it is possible. template<typename Func, typename C> ...
[no replies]
If statements for more than one term.
 
Hey, I need to make a program where it checks that all three of something is true, and then does something. Ex if (v1 == 8 || v2 == 7){cout<<"Hello"<<end...
[2 replies] Last: Aha! Thanks for your help! (by bosox99)
output numbers in pairs
 
Hello all! I'm trying to write a program that will cout every two numbers I enter. For example, if I were to enter 34 56 78 12 34 67 they would be output in pai...
[3 replies] Last: Yeah, it doesn't do anything. It just crashes. :( (by astraeos)
Problem with operator overload
 
A Position class is a class with x,y variables. I'm getting bad values of y when I try to add them together. If someone could point out a mistake, that would ...
[3 replies] Last: In the original you were returning a reference to the return value fro... (by cire)
by am0n
a little help?
 
Hello, I'm trying to write a little code Here it is #include <iostream> using namespace std; int main() { double mark; cout<<"Enter your mark = "...
[3 replies] Last: Thanks guys. (by am0n)
by ceyx
for each
 
hi, i'm new to c++ and i'd like to implement the observer pattern. i made an Observer.h and an Listener.h file but in my class that include those leaders, i t...
[17 replies] Last: You can only access member variables from an object like listener. lis... (by TheIdeasMan)
by tatai
using data from multiple files
 
I need to use data from three txt files. In file 1 there are 13 columns, in file 2 there are 3 columns and in file 3 there is 1 column. I want to prepare a 4th...
[10 replies] Last: In this case you can read all three files in a single while loop. I wo... (by jlb)
Arccos, out of range problem
 
Hello (sorry for my poor english) I need to calculate the angle theta between vectors v1 and v2 using the scalar product relation : theta=acos( v1*v2/( n...
[7 replies] Last: In my experience you can get these domain errors when the argument is ... (by mik2718)
std::string question.
 
Hello, I am curious if it is possible to create a string without using the 'new' keyword and access this string with pointers of other objects. Is it possible t...
[5 replies] Last: Hmm ok, thank you. But my main question was if there is any way to cre... (by zanklob)
Compiling Errors That Shouldn't Be
 
I don't know if I've just been staring at this too long or what, but I cannot for life of me understand the compiling errors I am getting. Care to run it yourse...
[5 replies] Last: Did you manage to meet the 10-15 line challenge? (by TheIdeasMan)
Trying to set max output width
 
Hey guys, I'm messing around with setw(), trying to make use of it, but it doesn't seem to be working. I'm pretty sure I understand the syntax and use of se...
[4 replies] Last: Since you're using a constant you should create a string to hold the i... (by jlb)
Test for whitespace in a file
 
This program I need to test for whitespace and newline characters. I'm given a text file with letter and symbols that the program converts so it is readable. I'...
[5 replies] Last: Welcome to the club cody0023. I have been having the same exact proble... (by chunkymonkey11)
sprintf() vs stringstream
 
Hi all, is it true that stringstream is the C++ version of sprintf()? And are there any performance differences?
[3 replies] Last: It is not true. They do different things. That you can use stringstrea... (by Moschops)
do-while error
 
First time asking a question, hopefully I get the format correct. I am using Xcode4. The following snippet of code will not build. Just curious if anyone had ...
[2 replies] Last: Yes, I do now. I had that statement inside the do statement with the ... (by cplusdude)
Help with a header file
 
So im quite new to header files and using more then one file in general. Ive heard that using a header file to place your functions in is a good idea usually so...
[2 replies] Last: Ahh ok thank you I think I got it all backwards. (by closed account 3qX21hU5)
by Rii
Finding the key of a vector.
 
Hello, I've been trying to find the key of a vector, but when I try to access the vector with an iterator and try to return a value it complains about "first...
[2 replies] Last: Thank you for your reply Peter! I misunderstood the vector, thanks fo... (by Rii)
Is it possible
 
Hi, is it possible to put this part of my program in a single function? I would like it to be within a function it would make my main only consist of functions...
[5 replies] Last: Looks like both codes you have given are same. int number=0; cin>> n... (by vichu8888)
Uploading prject source files
 
Hi everyone! I ... am emarrased to ask such a question but: Is there anything I should worry about or take into consideration when zipping up a c++ projec...
[no replies]
October 2012 Pages: 1... 3233343536... 84
  Archived months: [sep2012] [nov2012]

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