General C++ Programming - December 2017 (Page 2)

by Roson
Can I create a custom data type? (Not Classes)
Hello there! I was wondering if there is any way to create a custom data type. I don't mean classes, I mean a 3 bit data type that holds values from 0 to 7. ...
Dec 28, 2017 at 4:28am
[6 replies] Last: Heh, I let my save every ounce tendency take over. I agree with the ... (by Duthomhas)
by stav
*new* struct not getting initialized to 0
I'm doing the bunny excersise thingy, and i want to have a bunnyEvent struct. problem is, when i create it, it doesn't get initialized to 0 ? which is importan...
Dec 28, 2017 at 12:06am
[4 replies] Last: No. new T(); causes value initialization , while new T; causes ... (by mbozzi)
program crashes
Hello guys, I was trying to create a program that reads data from a txt file and store that data to an array. but unfortunately, my program started tp crash aft...
Dec 27, 2017 at 7:23pm
[4 replies] Last: I think that doing so increase the amount of complexity within the cod... (by benhart)
Optimization suggestions for linear probing table
Hi, I've written a rudimentary Linear probing hash table and I was wondering if you could suggest any optimizations for my search function. essentially my fu...
Dec 27, 2017 at 6:25pm
[4 replies] Last: I would seriously consider making it allocate max expected * X (you ca... (by jonnin)
Lights on/off programm
I have some problems with a code that I'm writing right now. I want to make a programm for a Raspberry Pi that should turn on or off my lights in my house. Any ...
Dec 27, 2017 at 6:23pm
[4 replies] Last: My programm does not work... I'm sorry to hear that. Please read: h... (by mbozzi)
Triangle program
Hi guys, I'm having trouble with this program. Question is write a c++ program to draw and fill a triangle given three sides. For some values, it works fine ...
Dec 27, 2017 at 2:56pm
[4 replies] Last: h is used in the for loop too. But what is it? (by jonnin)
How to make 2D OpenGL rendering efficient in C++
Hi, I am working on a little project in C++ using OpenGL. I want to be able to render multiple 2D rectangles either in some color or with texture as efficien...
Dec 27, 2017 at 2:46pm
[2 replies] Last: change the design. Class rectangle may make sense but draw inside ea... (by jonnin)
by dbag
Comparer question with custom Objects
I have the following list of person class to which I am sorting by full name and I apologize if this is a 101 question as I am still new to C++ and come from a ...
Dec 27, 2017 at 8:48am
[8 replies] Last: Thank you so much @JLBorges for the in depth explanation. You have no ... (by dbag)
waiting for answer
There is problem in the output where it is just displaying last values just displaying last row values for every output. # include <iostream> using namespa...
Dec 25, 2017 at 10:32pm
[2 replies] Last: This should fix you problem #include <iostream> using namespace std... (by noobofcpp)
getaddrinfo_a Windows equivalence
Hi everyone! I have to implement a client socket connection application. This application receives only one parameter : the maximum timeout for connect/read ...
Dec 25, 2017 at 6:08pm
[no replies]
reading data from txt file.
Hey everyone, I'm trying to create a basic program that reads data from a txt file that looks like this: /* data.txt */ var1 = value1 var2 = value2 var3...
Dec 25, 2017 at 9:12am
[8 replies] Last: Nah, people aren’t taught how to use C properly, so it looks like ma... (by Duthomhas)
get object idetifier
i want to get the identifier of a object class placeholder { string identifier = identifier public: void print(){ cout << identifier << endl; } } int ...
Dec 25, 2017 at 5:05am
[1 reply] : #include <iostream> #include <string> struct some_class { std::s... (by JLBorges)
String input
What is the best way to take a string as input ignoring the whitespaces? For example : If input is : IGNORE WHITE SPACE string should contain : IGNOREWHITES...
Dec 24, 2017 at 1:35pm
[7 replies] Last: Another option without getline and removing whitespace. In case the in... (by Thomas1965)
Ivor Horton Book: Using C++ Standard Template Libraries
Ivor Horton Book: Using C++ Standard Template Libraries 2015 Apress has C++ programming exercises at end of each chapter. At the beginning of the exercises the...
Dec 23, 2017 at 8:25am
[no replies]
warning signs
You are developing a program to control the warning signs as the exists of major tunnels. If roads are slick ( road_status is ‘S’) , you want to advise driv...
Dec 22, 2017 at 11:08pm
[9 replies] Last: You are not asking the right questions. If you want the code for this ... (by bheadmaster)
Randomisation Each Time The 2D Array Is Called
Basically I am making an adventure game in a 2D array, I would like the character to move around fighting monsters and have that represented in a 2D array. I ha...
Dec 22, 2017 at 9:51pm
[3 replies] Last: Thank you both for replying, I have looked over what you both have sai... (by JustMike)
C++: how use arrays on our class's? (1,2)
see my class: class Sprite { private: LPDIRECT3DDEVICE9 sprDevice=NULL; LPD3DXSPRITE sprSprite=NULL; LPDIRECT3DTEXTURE9 sprTexture=NULL; pub...
Dec 22, 2017 at 8:55pm
[21 replies] Last: 1.b and 2 works fine. but the 1.a have a memory leak. maybe because i ... (by Cambalinho)
Playsound only when specific key is pressed
i am making a program in c++ but i want help in playsound fuction i want a specific sound to be played only when a specific text is entered for exampl...
Dec 22, 2017 at 8:32pm
[1 reply] : Use SFML.Use sf::SoundBuffer to load the sound file you what then use ... (by noobofcpp)
c++ programmin problem please ! any one can show how this be?
A PROGRAM THAT READS IN THE EXAMINATION NUMBER OF CANDIDATES IN RANGE OF 0-32768 TOGETHER WITH THE PERCENTAGE MARKS ATTAINED IN A GIVEN EXAMINATION .THE MARKS...
Dec 22, 2017 at 7:26pm
[5 replies] Last: The premise of your question is slightly wrong because the question is... (by Ganado)
Improper locale definitions
A C++ implementation defines both: 1) the named locales that are available and 2) the definitions of the facets contained in each locale. The C++ standard ...
Dec 22, 2017 at 3:37pm
[3 replies] Last: I could never be sure that the locale in fact encapsulates German con... (by Cubbi)
December 2017 Pages: 1234... 13
  Archived months: [nov2017] [jan2018]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.