General C++ Programming - April 2014 (Page 18)

LDBL_MAX cannot Obtain
 
I could not obtain anymore the right value for the Maximum Value of a Long Double using the LDBL_MAX definition... cout << "The maximum value of a long...
[1 reply] : I don't think long double was a standard type in C++03. Try if compili... (by Peter87)
c3867 and c2109
 
this code gives a c3867 and c2109 errors. can anyone tell me what could be done to sort that out..? Player is my class and cplayer is its object, it has getsc...
[1 reply] : Look at the code highlight. You have stray " at the end of line 5 (by MiiNiPaa)
Opening DOS Shell on XCode
 
Recently we started working on text and binary files at school! There my teacher asked us to use the 'copy con', 'edit', and 'type' functions to create, edit an...
[no replies]
c++ irc bot not working
 
im writing an irc bot in c++ on linux mint, and its not connecting right for some reason. anyways, heres the link: http://pastebin.com/mHrn8iLQ . it was connect...
[12 replies] Last: never mind i figured it out. (wasnt allocating response correctly) (by Little Bobby Tables)
Simple code
 
Can someone come up with a simple code that will add one everytime I press "press any key to continue"? I have made an array that will spit out a list of num...
[19 replies] Last: @ldm: is nul a special windows keyword then? regardless you still shou... (by Little Bobby Tables)
binary search tree printing
 
I am not sure how to use the parameters ostream and enum type in a print function. Can someone tell me if this print function looks correct. enum Travers...
[2 replies] Last: On the prompt that I am given, the out stream is not passed to printHe... (by monstur)
by bonita
I dont know what the problem is with this
 
This is my client code. when I send msg. it sends fine but and then gives me msg "segmentation fault core dumped" right after I send the msg. the result of Cli...
[1 reply] : Hey friend! Do you know how to use a debugger? This may be the perfect... (by ultifinitus)
Find prime numbers between a given pair of numbers and store them into an array?
 
Find all the prime numbers between a given pair of numbers. Numbers should be read in from an input file called "numbers.txt" and find all the prime numbers b...
[1 reply] : #include <iostream> // std::cout #include <fstream> //std::ifstream ... (by iQChange)
Blank Variable
 
Hello. I have a string that is from an external txt and the user is supposed to have put something there. Is there any way for me to say: If the string doesn't...
[2 replies] Last: Oh thanks Zhuge. I made a stupid mistake and only put one = and didn't... (by JasperBraun)
by teslaa
Reference bind in winsock2.h
 
I have a simple c++ application and I want to create a thread using <threads> and a socket using <winsock2.h> however when I call to bind to the socket I am get...
[no replies]
cancel destructor calls in operator delete[]
 
Let's start with something from the c++ reference: ... delete is an operator with a very specific behavior: An expression with the delete operator, first ...
[12 replies] Last: @Disch did you compile and run? Not at first, no. But I did just ... (by Disch)
Removing part from a vector of sets
 
Hello, I was helped earlier, and I was hoping I could be helped again. I have a vector of sets, which I am removing any element which contains a certain valu...
[4 replies] Last: I have yet to see any for_each statement that was not simplified by a ... (by Disch)
Help prevent hackers on network game
 
Hi, This isn't really a c++ question but more of a network question for my online game. First of all when I say "Help prevent hackers on network game" what I ...
[2 replies] Last: bump (by danielmccarthy)
displaying file the same way it was made?
 
If I create a file that looks like this for example, car 2 4 6 8 truck 1 2 3 4 5 6 plane 4 5 6 7 9 Whenever I go to open it back up like this, ifstream ...
[2 replies] Last: Thanks! That worked (by nevetS246)
bad_alloc exception even though memory available
 
Hi, I have code (C++ under Windows 7 using VS2010) that creates many objects on the heap, each with a STL map<string, double> in it, and then inserts about 100...
[5 replies] Last: Thanks for the advice. It seems that the LARGE_ADDRESS_AWARE solved th... (by yarivadam)
VC++: writting in txt file (trouble in loop).
 
Hi, I'm wanting insert text in a txt file, but I'm having troubles. When I execute the program txt is create and simply his begin flood infinitely with stranges...
[no replies]
by PadMad
SDL 2 / blitting too slow
 
Hey guys, First, I'm new to the forum and hope it's the right section. I'm tryin' to code a simple SDL2 program, that uses an own mouse cursor and animates a m...
[12 replies] Last: I kind of solved it now. I set the background color to 0x0f, 0x0f, 0x0... (by PadMad)
random numbers
 
Hello is it possible to get such numbers as 0.125 , 0.25844 , 0.8989 double 0 to 1 but not 0.000011121
[3 replies] Last: To get a number between 0 and 1 as a double, do this: double d = (do... (by Stewbond)
Get Wrong return value
 
Here is my code to find the index of a string array whose string is equal to the query string. I have checked the program can return the correct index, but the ...
[4 replies] Last: I got it. Thank you very much. (by andrewlin2011)
Running a 2013 project in 2012 Visual Studio
 
I ran out of my trial period for VS2013, I didn't think it was trial b/c I got it from the school. I downloaded VS2012 and it is not allowing me to run any 2013...
[2 replies] Last: Thanks bud! (by closed account zqMDizwU)
April 2014 Pages: 1... 1617181920... 41
  Archived months: [mar2014] [may2014]

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