General C++ Programming - November 2013 (Page 20)

by LB
Not picking template partial specialization?
 
http://ideone.com/ChET01 #include <iostream> #include <type_traits> template<typename T, typename = void> struct Test { static int constexpr value = 1; ...
[3 replies] Last: With template< typename T, typename = void > struct test as the gene... (by JLBorges)
by AceK
'If' statement problem.
 
hi everyone, i have the "if" statement below. the purpose of this 'if' statement is to check if the string 'LoginDetail@#%$^*&_FhDKooKSE' is contained in the QB...
[1 reply] : I think this is because the statement 'socket.readAll()' is executed ... (by SneakySnake)
by enemy
conversion fro int to int*-error
 
Hello! Please what is wrong here: int Ave(int array_f , int& sm) { int k=0; do { int e=1; for (int i=2;i<sm;i++) { if (sm%i==0) { e=0;br...
[4 replies] Last: Thanks, shadow fiend!!! (by enemy)
Not sure why game is exiting
 
I'm creating a game of go fish, but for some reason it is exiting after the computer's turn. Could someone give a hint or solution for why the program exits? I...
[1 reply] : // Now the computer's turn, very similar to the above function void c... (by vin)
Hello World fatal error
 
Write your question here. Hello World not working they say 1>------ Build started: Project: HelloWorld1, Configuration: Debug Win32 ------ 1>LINK : fatal ...
[4 replies] Last: No problem man, you shouldn't have to buy a new computer though... you... (by tree)
by olleh
error: invalid operands of types 'int()' and 'int' to binary 'operator%'
 
#include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { srand(time(0)); int numOfDice; numOfDice =6; int remo...
[2 replies] Last: Thank you! (by olleh)
Error with value being returned
 
Hello guys, I am working on my final project for my class and after finally getting it to compile with no errors thanks to finding examples/tutorials and follow...
[9 replies] Last: You forgot to put braces around lines 161-167. (by long double main)
iterator to a vector of a struct type?
 
I'm working on a program where I have a vector full of <myClassType> structs. I'm trying to insert items into a vector, searching first through the vector to...
[3 replies] Last: Wow. That was amazingly fast. Thank you both very very much. I had ... (by susansuth)
by xismn
Return out-of-scope reference(?)
 
Howdy, I'm a little baffled as to why my compiler isn't complaining when I return a reference, which falls out of scope. #include <iostream> int& foo() { i...
[6 replies] Last: I see. Thanks for the input! (by xismn)
by LB
Why can't it deduce the class type?
 
http://ideone.com/DbOImJ #include <iostream> #include <type_traits> struct Test { void f(); template<typename T> using verify = typename std::enable_...
[2 replies] Last: Thanks, I came up with a solution similar to this. (by LB)
by seerax
Outputing text
 
string b; ofstream outputFile; cout << "What do you want to call the new output file " << endl; cin >> b; outputFile.open(b, ofstream::out); ...
[3 replies] Last: For most purposes, it's probably okay to just do something like cin... (by long double main)
Board with array
 
http://d.yimg.com/hd/answers/i/675e8f55fbfe4241bd8608794c30406f_A.png?a=answers&mr=0&x=1384732009&s=abe4ccb547eed08bbad5964422af74b7 How could I make a bo...
[1 reply] : Here's my code: #include <iostream> #include <windows.h> ... (by fercasti)
Input File
 
I need help displaying the number of tasks for an event from the text file that I have created and input into my program. Please help! I'm posting the code in h...
[no replies]
overload with template function
 
I am a new beginner,got confused about: template<typename T> int compare(T &a,T &b); int compare(const char *a,const char *b); char ch_arr1 ="world",ch_ar...
[15 replies] Last: Really appreciate. (by kakyleung)
C++ project
 
This is the features that needed to be added to program 1. Ok now take what you’ve written for Part I and add a menu for the user. It should include all th...
[no replies]
Using C-String vs String Class
 
Hey guys, I'm working on a homework assignment where I have to write simple program to re-arrange someone's name. The catch is that I need to write two versions...
[no replies]
not reading entire file
 
Hey Guys, I could really use some help. I have a file that looks like this: 4 5 2 8 1 2 ...
[no replies]
reply ASAP
 
#include <iostream> #include <sstream> using namespace std; //learn to avoid this... for now, not a big deal //iterate through a string to check if it's a ...
[2 replies] Last: well half of it is my code and the half of it is what i got as a quest... (by Needhelp7589)
Program Freezing - miss worded code?
 
Hey Everyone, I have finally written code that when I run it I have no errors and DeBug actually works! But now the program gets hung up and doesn't do what I i...
[4 replies] Last: for line 179 180 181 if I don't have that in there I get all these er... (by stardust2552)
by LB
How do I use extern template w/ template specialization?
 
http://ideone.com/wGztUW #include <iostream> struct Outer { template<typename T> void go() { std::cout << Test<T>::f() << std::endl; } private: template...
[1 reply] : OK, apparently it wasn't so hard: http://ideone.com/opOr15 #include <i... (by LB)
November 2013 Pages: 1... 1819202122... 46
  Archived months: [oct2013] [dec2013]

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