General C++ Programming - November 2010 (Page 18)

by Null
GCC segmentation fault
 
c:\program files\mingw\bin\..\lib\gcc\mingw32\4.5.0\include\c++\bits\stl_algo.h||In function '_RandomAccessIterator std::__unguarded_partition(_RandomAccessIte...
[4 replies] Last: gcc is buggy... (by jsmith)
0xcdcdcdcdcd
 
Do you need to do delete these pointers? I know they're not null but as far as I remember it's also not a valid memory adress. I'm having problems with a memory...
[8 replies] Last: It's Java that's driving the price of RAM down. (by helios)
Strange behaviour of std::valarray
 
I've got the following code: #include <iostream> #include <valarray> using namespace std; int main() { valarray<int> a(2); a = 2; a = 1; a = a...
[no replies]
Array and Structure Issues
 
I'm trying to write an input function which takes in a struct array of type video, and it size, as its formal parameters and then get the titles of five movies ...
[2 replies] Last: The technique of doing typedef struct Tag1 { // ... blah blah ... (by jsmith)
Tied my hands behind: replace C string spaces with "%20"
 
Came across Java code and wanted to implement it with C/C++ code: Given a C string, replace each space of it with "%20" with the following prototype: void ...
[1 reply] : You're assuming that the buffer passed in is large enough to be expand... (by kbw)
How to create grayscale pixel value array
 
Hello. Thought I'd ask; having a hard time figuring this out on my own. I am using Borland C++ Builder 6 on a PC running Windows XP. I have a black and w...
[2 replies] Last: gray = (red * 0.30) + (green * 0.59) + (blue * 0.11) (by Duthomhas)
Read ASCII file into matrix in C++
 
Hello everybody, I am new to this forum. I got a stuck in my work ... I have ASCII file with numerical values, and I need to read them and save them in a ma...
[10 replies] Last: Hello guys, Thanks for your helps and suggestions. After I follow... (by abotaha)
When using new
 
Hello everyone, I was wondering what the difference is between a normal array declaration and when using new . When I see this: void Func() { char b...
[4 replies] Last: stack size is different depending on the computer/user settings/etc. (by Disch)
by eruina
Validating user input using try-catch with reprompt
 
Hi all, To handle invalid user input, I usually just loop to reprompt until the input is valid. But my assignment details states that I need to catch mult...
[2 replies] Last: Aw shucks.. I'll try to catch my prof then Thanks for the reply! :) (by eruina)
by nguyen
class destructor
 
Hi all, I have a simple class and have problem with the destructor. In the code posted hereafter, the following works well: A+B+C; but I have problem w...
[5 replies] Last: Thank you again, jsmith. Nguyen (by nguyen)
Keep getting same results.
 
I'm a little confused about structuring the code. Keep getting the same output. It's supposed to be a program that lets you choose the watch you want to buy and...
[4 replies] Last: Yay! It worked. Thank you all. You've been a great help. (by Elmofongo)
Setting _kbhit back to 0 (False)
 
Hi there, I'm new to the forum, and I'm also new to c++ programming. Lately I was trying to make a code that would serve for a game of guessing. It should pick...
[2 replies] Last: Thanks mate!!! (by Nenad Zivic)
Sorting By Data Members
 
As the title suggests, I'm trying to find a way to sort a list based on the data members of a class. Example: class Object { public: int a...
[4 replies] Last: If you just want to compare a single element instead of all of them, t... (by jsmith)
Check a object exists or not
 
how can i check that a particular object still exist or it has been deleted ? Thanks
[4 replies] Last: Weak pointers. But they require that the object's lifetime be managed... (by PanGalactic)
socket bind fails second time round
 
I have the following code that I use to receive UDP data. It is in a function that i call every now and again. char recvbuf ; int iResult = 1...
[6 replies] Last: yeah, sorry, I only know the posix calls. (by jsmith)
by keithk
How do I iterate over a set of sequentially named objects?
 
I have created a series of instances of a struct inside a for loop. They all have names like object_0, object_1, and so on. Now during my render loop I need t...
[3 replies] Last: +1 to Zhuge. As a general rule of thumb, if you're naming things fo... (by Disch)
Memory leak in my String class +operator
 
There is a memory leak that is occurring in the + operator. For example str cdir("C:\\FIPM\\DataBases\\TSD\\"),cadd("TsdDaily.dbf") ; str ctmp = cdir+c...
[2 replies] Last: xorebxebx thank you! (by jeremyk)
Convert contents of ASCII to binary
 
Hello, I am trying to convert the content of ASCII text files into binary. Below is what I came up so far but not solving the problem. std::ifstream infi...
[6 replies] Last: Why not indeed! Thank you! (by lseongjoo)
by Bezi
resource for developing dynamic library
 
I need help with how to write a dynamic library in C++, __declspec(dllexport) kind of stuff. Can anyone introduce me a good resource, preferably online?
[1 reply] : http://www.google.com/search?q=how+to+write+a+dll For UNIX systems it... (by helios)
creating a simple program to create a venue event
 
Basically it would take the name, address of the venue then take the row name and total number of seats in each individual row. furthermore it needs to take sec...
[no replies]
November 2010 Pages: 1... 161718192021
  Archived months: [oct2010] [dec2010]

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