Beginners - May 2011 (Page 26)

problems of promotion traits
 
I have some problems about promotion traits template<typename T1, typename T2> class Promotion; template<bool C, typename Ta, typename Tb> class IfThenElse; ...
[1 reply] : Both seem to compile and output the same results on Ubuntu 64 using g... (by kfmfe04)
Converting two dimensional array to double pointer (T[][]-->T**)
 
How can I convert a two dimensional array to a double pointer? int f ={{1,2,3},{4,5,6}}; int** dreamon=f; The above does not work, giving the error ...
[3 replies] Last: I would just have to find the pointer of each 1D array referenced by ... (by Disch)
Nested vector holding user-defined class, won't compile
 
This code won't compile. It actually doesn't give me any problems until "board.push_back (row);", at which time it gives me a very long and complicated compiler...
[2 replies] Last: Objects stored in a vector need to be default constructable and assign... (by PanGalactic)
dijkstra algrithm
 
Hi, i just have question about the dijkstra,does finding the lowest cost in this function means same as finding the shortest path between two places?
[1 reply] : Please do not double post. http://www.cplusplus.com/forum/general/4300... (by PanGalactic)
skiping duplicate entries in a program
 
I am trying to write a program that alphabetizes names in a file. The program is supposed to skip any blank lines as well as any duplicate names. I can make it ...
[6 replies] Last: Wow great.. it works thanks for your help!! There are some problems th... (by forpblop)
Questions about double-pointers (int** q)
 
Does the “new” operator delete whatever the variable was assigned to? Example: Int p ={1,2,3}; p=new int ; //is delete p called? How can one a...
[2 replies] Last: Thanks Zhuge for your quick response. (by helasraizam)
Switch statement and Writing to a file
 
I have a ofstream within a case. case 1: ofstream myfile1 (file18.c_str(), ios::app); if (myfile1.is_open()) { while (myfile1.good()) { myfile1 ...
[2 replies] Last: Posting the rest of your program would be beneficial. Maybe try to dec... (by TrevorD)
random function
 
How was the random function written? Where could I find the code, or would one of you be able to paste it up here?
[2 replies] Last: http://www.cplusplus.com/reference/clibrary/cstdlib/rand/ (by LittleQuick)
about this forum
 
I want to know is this forum only good at asnwering c++ or it can also answer technical problems?
[2 replies] Last: okay. (by jimmy5023)
Int to string
 
Hey, I've recently been learning some C# and it's been really helpful that every type has a .ToString() method inside their class and I was wondering if there ...
[8 replies] Last: I'm sorry but did any of you even read my post?? I appreciate the ans... (by Duthomhas)
by tonnot
How to return different types ? (1,2)
 
I'd like to have a function to return a different type depending if the result can be a double a float an int or a long. Is it possible ? Thanks
[29 replies] Last: Well, I figure its worth one more shot... Your design is flawed, an... (by Duthomhas)
Get long value from main()
 
Hi In my new program I want to get very long value(ex, 13412345236234514123523462354) as parameter from command line,and then process it.I have 2 problem : 1-...
[2 replies] Last: nima's example number is too large even for a long long. Your best ... (by Disch)
by tonnot
Istringstream gives me wrong result for a signed short int
 
I have : signed short int my_i // -32768 to 32767 std::istringstream i(value); i>>my_i Ok, if I pass value "38000" my_i gives me -27536 Ok, if I pass valu...
[1 reply] : This is correct: 38000 wraps around (due to sign extension) to -27536 ... (by kooth)
Dijkstra's Shortest path algorithm help
 
Hello, I'm trying to complete dijkstra's algorithm but I'm having a really hard time figuring it out. I've made a table with three array's that will keep tr...
[no replies]
by Liang
How to use libraries not in standard path?
 
I need to use libraries (gsl and deal.ii) to be installed in a public server. I don't have administrative privilege, so they are installed in my home directory....
[2 replies] Last: The deal.ii library works using the provided Makefile. But it is very ... (by Liang)
initializer fails to determine size of...
 
Am I writing a programme intended to read a text file and format the contents. The text file is one long line, and should be formatted such that a new line is u...
[1 reply] : char str = line; 1) This doesn't work and 2) It's kind of stupid ... (by firedraco)
c++ window form
 
Hi guys, I am a new user for c++ window form. I want to catch a text "from a textbox" and store it into a variable like k for example Thanks in advance
[1 reply] : cli is not C++, but check these links: http://www.functionx.com/cppcli... (by matsom)
Please review my code.
 
#include <iostream> //This will create a function that prints 'You just called a function.' void function() { std::cout << "You just called a functio...
[5 replies] Last: The add function he made takes two parameters and then adds them toget... (by king214)
by Pascal
Please help!
 
So, i'm following a tutorial provided by Microsoft Visual studio 2010. And i have sumbled upon an error while debugging, i have no experience using c++ so i don...
[4 replies] Last: THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! When i went back and look... (by Pascal)
Program terminates unexpectedly
 
Hi i've been making a game in c++ and SDL (codeblocks IDE) and my program terminates unexpectedly on occasion giving no clear error message. Now i have around ...
[1 reply] : The trick is called debugging. Select Debug/Start or "Step Into". Make... (by Athar)
May 2011 Pages: 1... 2425262728... 48
  Archived months: [apr2011] [jun2011]

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