General C++ Programming - February 2010 (Page 3)

Share Data Between C & C++ program/ Function
 
// This is My Client TCP program in C++ // Program Name client.cpp #include <winsock2.h> #include <iostream.h> #include <windows.h> #include <iomanip> ...
[1 reply] : What, exactly, are you trying to do? Sharing data between functions co... (by Zhuge)
by Ryan99
Possible to redefine a define in a different file
 
I created an include for loading\saving binary data. The language I am working with (Pawn) does not allow dynamic memory allocation so it must know array sizes ...
[9 replies] Last: You could do this instead: #ifndef SIZE #error "Please #defin... (by Disch)
makefile issue undefined reference to main
 
I'm getting an undefined reference to 'main' error. I tried a few things and can't seem to quite get it. I'm trying to make the name of my executable hw1.exe a...
[3 replies] Last: I don't see anything terribly wrong with your makefile. If anything, ... (by moorecm)
segmentation fault on some linux machines
 
I have written the following code which gives a segmentation fault on the line delete string1; This behavior is seen only on a few linux machines and I woul...
[2 replies] Last: Line 10 is overflowing the 'num' array. tempString doesn't reserve sp... (by helios)
Question on writing a simple program for class
 
I'm taking an introduction class in C++ and need a little help with an assignment. I need to write a simple program for the following: Write a complete progr...
[3 replies] Last: Glad to help out. (by moorecm)
Using pointers to member functions as indexes for a map
 
Hello, I am working on saving and restoring a complex class to and from a txt file. I am stuck on trying to save a list of pointers to member functions of a di...
[2 replies] Last: and I`m not sure if they would be the same each time the program is r... (by jRaskell)
Random seed change by regular "rand()" usage
 
Good morning, I have a program, running on UNIX Solaris 5.8, on which there is development kit "dbx 6.2". This program uses the C++ function "rand()". My cus...
[2 replies] Last: rand() is a linear congruential random number generator. Let the va... (by jsmith)
.txt into a 2d array
 
I am writing some code to read the contents of a very large .txt file (about 45 rows by 39000 columns) into a 2d array. Each number varies in size but they are ...
[2 replies] Last: Hope this will help!! #include <conio.h> #include <string> using na... (by bluecoder)
base36
 
Hi guys, I am creating a program for a serial base output. But i am having trouble on creating base36 sequence. I cannot use "if else" condition to this on...
[8 replies] Last: good luck ^^ (by blackcoder41)
by wAaKcU
Date string to time_t
 
Hello, How can I convert a date string such as dd.mm.yyyy or mm/dd/yyyy to time_t? I've spent many, many hours trying all sorts of stuff and googling, but I ...
[3 replies] Last: Convert the two dates to Julian days then subtract and convert to seco... (by buffbill)
STL Container Memory Management
 
I'm a little confused. I've used containers before but I don't know (at least now I don't) that I've been using them correctly. When I make a vector of a he...
[9 replies] Last: You are totally and completely wrong kempofighter. For ever call to... (by closed account 1yR4jE8b)
-999 ?
 
Ok I'm reading my C++ book I got in college, I'm on chapter 8, about 500 pages in. The book is talking about a program that calculates grades from 2 input files...
[3 replies] Last: .........meaning that somewhere within the loop body there will be a d... (by buffbill)
getting words from a file to store in string vector
 
I'm trying to write a program to extract words from a text file and store them as strings in a vector of type string. When I try to execute it, the program hang...
[3 replies] Last: OK, let's see... perhaps you should close infile after you are finishe... (by tummychow)
by Alan
Function
 
How could I model this function? http://img202.imageshack.us/i/mysterygraph.jpg/
[3 replies] Last: something which looks like this: asin ( sin( x ) ) (by Bazzy)
design quesiton
 
I was given a problem to design a function to compare two maps and see if they are equal. The value type of the maps can be primitive types like int, float etc....
[6 replies] Last: Both std::vector and std::map already have operator== defined that doe... (by jsmith)
by Bazzy
% operator
 
According to the standard: the binary % operator yields the remainder from the division of the first expression by the second. If the second operand of / or %...
[17 replies] Last: The reminder should be 0 ≤ r < m The lecturer defined the remain... (by closed account z05DSL3A)
c++ header file
 
Hi to all, As iam stuck up with my program and i need some to complete that one. I wrote two programs for binary search tree in graphics. one program is for ...
[8 replies] Last: That's fine, but don't use void main() . I've said it about five ti... (by chrisname)
Problem With Concatenated Array
 
yas
[6 replies] Last: Angelina, .. u cannot miss passing arguments to ur function!!! nevert... (by vijaysaluru)
Floating point exception
 
I'm not sure on why this is happening. For some reason these values aren't being stored. This is part of a PlayerDatabase class, that takes in a Pitcher or Hit...
[3 replies] Last: As I said, its fastest when you try to simplify the code more and more... (by imi)
Dynamically allocate an array of Pointers to class objects
 
Hey everyone, I'm all out of idea on what I am doing wrong here. I'm trying to overload the '=' operator by dynamically allocating a new array of pointers to cl...
[6 replies] Last: That did it thanks for the help Disch (by PatCioe)
February 2010 Pages: 12345... 21
  Archived months: [jan2010] [mar2010]

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