General C++ Programming - January 2016 (Page 4)

by tony62
How to create the equivalent of sub-type
 
In the Ada programming language, it's possible to declare a type or sub-type, like this: type DAYS_OF_YEAR is range 1 .. 366; type PERSONS_AGE is range 0 .. ...
[2 replies] Last: Thanks Cubbi, your answer was very helpful. Tony (by tony62)
c++ win 32 adding list items into a combo box
 
I want the user to select from a drop-down list of items in a combo box. I have called the WM_CREATE function and the user can input text. Here, I've bee...
[3 replies] Last: coder777 was right. When the height of the combobox is >= 80 both item... (by Thomas1965)
by Kubani
MySQL and C++
 
Hello to all, I have some knowledge on C++ and know that being familiar with MySQL will be a must soon. Now how to learn MySQL please? I heard that I can learn...
[3 replies] Last: Thank you two very much for your guidance. Whatever I have learnt so ... (by Kubani)
Updated 8 page Reference
 
Updated 8 page reference for C++: http://home.uevora.pt/~pmaa/cpp.pdf Hopefully, those concerned with completeness will point out the missing unions, mult...
[2 replies] Last: Helios: Did you open it? Syntax only, of course. And it's pretty dense... (by simplas2002)
Unexpected break in main() using larger file on working code
 
I have been given multiple .txt files of varying sizes (from just 50 to 3 million). Each line contains two 'names' of 8 randomly generated characters separated ...
[2 replies] Last: That worked a treat! Thanks TheIdeasMan! It never occurred to me it wo... (by beeclear953)
by Goakki
Help!! some issues with creating a prime class
 
The ++ operator just can't overload. I want to know what is going on. Every time i cin a number, it only gives the origin one back to me. Thanks for your help!!...
[2 replies] Last: You cannot return a reference to a local variable (or temporary) in a ... (by cire)
saving multiple struct based records generic question
 
ow do I make a struct of variables/values that can be saved in an array like fashion? Meaning I want to make 10 records of the struct below for example of 10 pe...
[2 replies] Last: Hi, Declare a std::vector<foo> MyFooData; Then use MyFooData.push... (by TheIdeasMan)
by abc1
Typechecking in macros
 
Macros does not support type checking but functions support type checking. So what is type checking? Please clarify.....
[1 reply] : http://lmgtfy.com/?q=C%2B%2B+type+checking (by AbstractionAnon)
Undefined reference? (1,2)
 
When ever I try compiling this code I get undefined reference to something::get why is that? #include <iostream> using namespace std; class something { ...
[23 replies] Last: Yeah I understand it now, I was thinking I could just change/switch ar... (by rabster)
problem with a program that should copy a file
 
HI PROGRAMMERS! i want to write a simple code that take a copy of the file from address below C:\Windows\System32\telnet.exe and then paste it into us...
[1 reply] : #include <iostream> #include <string> #include <shlobj.h> std::wstri... (by JLBorges)
delete function not working
 
Q) I have made a project on airline management.In this my delete function is not working. On using the function the program exits and when we use display all bu...
[2 replies] Last: yes... kk will try (by stuti15)
Question on Big Oh notation
 
Sorry if this is not the right place to ask this. We say that f(n) is Big-O of g(n), written f(n) = O(g(n)), if there exists positive constants c and x such th...
[8 replies] Last: I got it. Thanks you for the help! (by OPzCatchMee)
by mrsh
C++ not responding
 
Hi,I'm new to c++, I want to solve linear equation and try to run this code from http://eigen.tuxfamily.org/dox/group__TutorialLinearAlgebra.html,everytime I t...
[3 replies] Last: Sorry for late reply, I did install the Eigen system and the header fi... (by mrsh)
by sjdods
I need some help with the Dice game. Could someone help me with this, please?
 
Hello. I am trying to figure out a dice game so it would output the type plus how many it output. I need to use vectors and arrays. For example: Five of a k...
[3 replies] Last: Thank you so much! I got it to work. (by sjdods)
by abc1
inline function
 
I have a doubt in inline function vs normal function why inline function is faster than normal function? please explain
[5 replies] Last: Consider the worst case where a non-inline function is in another comp... (by dhayden)
Making Shapes
 
So I have the following code that will print the shapes of a triangle and a diamond. How can I change it to make the user tell which shape they would like to ha...
[3 replies] Last: No. You could build the whole thing in one function with if statemen... (by Moschops)
by homing
Portable Code - Type Size problem
 
Hey, As far as i know, types (e.g int) might have a different size on different plattforms, therefore you should create typedefs to avoid the problem(int32,int...
[6 replies] Last: > what problems may actually occur if I just use int for every plattfo... (by JLBorges)
Downcasting - Is it that bad?
 
I've been working on a 2D risk clone recently, and after a friend of mine reviewed my code he pointed out that downcasting should be avoided at all costs. My si...
[5 replies] Last: That's actually precisely what I do I don't think so because Instan... (by dhayden)
by Blerta
Pleaseeeeeeeeeeeeeeeeeeee , help me ... i cant get the solution ..
 
Build a class named "salesCompany". Save it's name with a string and an array with records which will be filled with values from sales in different cities of th...
[2 replies] Last: What do you have a problem with? (by kbw)
sorting certain string member in an array struct
 
i am having trouble with the sortName function as it is not sorting the strings.I am weak on string sorting, havent done much work with it. Not sure what i am d...
[1 reply] : You can't declare static arrays like that. cout<<"How many students ... (by Thomas1965)
January 2016 Pages: 123456... 18
  Archived months: [dec2015] [feb2016]

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