Beginners - December 2013 (Page 15)

explicit specialization: why can't with char *?
 
why? It tells me: error: no instance of function template "hey" matches the specified type. template <class T> T hey(const T); template <> char* hey<c...
[7 replies] Last: > if the template be like this: > template < typename T > void hahah... (by JLBorges)
Structure in C++
 
Need help here, is there something wrong with my code? Here is the code, #include <iostream> #include <conio.h> using namespace std; int main() ...
[8 replies] Last: What are you trying to print? You have no class called date with a mem... (by Zhuge)
by edison
conditional compilation in C++
 
An exam question Which of the following statements accurately describe the condition that can be used for conditional compilation in C++? A. The condition c...
[1 reply] : What do you think the answer is and why? (by firedraco)
recrusive function logic trouble :(
 
Hello, I was preparing myself for the upcoming semester when I came across this problem that has caused me a bit of trouble. This is a program i've written that...
[1 reply] : Your program seems excessively complex. It would be much simpler to wr... (by heebleworp)
why use (void *) to display char arrays' addr?
 
and (int *) works, too. How to understand this usage? char arr = "Hello!"; cout << (void *) arr; i mean why void and int other than double or long someth...
[4 replies] Last: oic thx :> (by q1670741824)
Is it safe to assign a pointer to a constant?
 
char * a = {"hello", "world"}; int * b = 3; Is it safe to do so?
[3 replies] Last: thanks, i get it. (by q1670741824)
Run Time Check Failure #3, What Do I Need To Change?
 
I managed to get two working so far (reading from an external file, but I can't seem to get the third one to work, can any one show me what I have done wrong? T...
[no replies]
by Hydrox
.txt to Array: wrong cout value.
 
I've taken the 1785 values in the Stats.txt and converted them into an array. But when I attempt to output the last value, it gives me the second to last. ...
[1 reply] : isn't the size of values should be 178 5 ? (by nvrmnd)
fstream
 
if instead of ifstream and ofstream we could you use fstream which can do both of the functions why use ifstream and ofstream
[8 replies] Last: That makes sense to me too. Thanks Chervil. (by CplusplusAcolyte)
by alekz
Please help with program due Tomorrow!!
 
Write a program that calculates the varying internal temperature of an object. The object’s shape is a rectangle and it is subject to fixed temperatures at it...
[6 replies] Last: Squinting hard to read your unformatted code, this line leaps out at m... (by MikeyBoy)
Aligning Characters
 
I'm struggling to align my '*" perfectly. I have made an multi dimensional array that will intilize each element to "*" and then I want to out put that in a cer...
[3 replies] Last: sorry guys. I thought I had posted my code already, but here it is :D ... (by fahmankhan75)
by dp13
nested ifs
 
Hi all and thanks for any help. I'm Finishing up my finals and my brain is fried. Why oh why is this nested if not setting the value (hour += 12 ) properly? ...
[4 replies] Last: Thanks, I changed the code already. Had a moment of clarity. (by dp13)
by gghf
Best way to share a variable between classes
 
So I am learning about OOP and inheritance as I work on a programming project. Basically for one part of the project I have a set of bool variables that needs t...
[4 replies] Last: This bool should be part of the Monster class. Whether or not the mon... (by Disch)
Difference between strcpy & strcpy_s
 
can someone please explain to me whats the difference between these two if there is any? on my current assignment I've done everything correctly, however ...
[2 replies] Last: According to Wikipedia, strcpy_s *is* a standard: strcpy_s - C (2011)... (by bobdrad)
help for if else
 
i just write for a small code for the homework, there is a part of if, else statement. but there are a problem. once, I type right stock name, and numbers to bu...
[no replies]
Circular Dependencies
 
Hi, this is kind of a spin off of my last post (http://www.cplusplus.com/forum/beginner/120329/). I have some weird include problems, it potbelly has to do wi...
[3 replies] Last: Lowest0ne: to be honest i started off doing it with the constructor bu... (by Precious roy)
by layanM
help plzz
 
: Let us roll dice Write a program that simulates the rolling of two dice. The program should use the function rand() to roll the first die and use rand() aga...
[1 reply] : Use the existing thread: http://www.cplusplus.com/forum/beginner/12033... (by booradley60)
Struct variable.
 
Hey guys , why can't I use the tried struct in " k " function ? I declared the struct as a global variable and I still can't use it , why ? #include <i...
[4 replies] Last: Oh boy , stupid me , I forgot it ^^ thank you so much. (by Cutefriendzoned)
from [int] to [float]
 
hi guys i have code, that swaps columns with minimum and maximum element but i need to change the datatype numbers of matrix from int to the float also (mayb...
[no replies]
scope of variables in included files
 
i made a function that i would like to put in its own .h file so i can 'black box' the function. after the calculation is done i have to use the resulting arra...
[no replies]
December 2013 Pages: 1... 1314151617... 69
  Archived months: [nov2013] [jan2014]

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