General C++ Programming - November 2008

by chris
Dynamic Memory
 
Greetings, when programming I usually use C as opposed to C++, & when using dynamic memory use malloc & such functions seem a bit much code when I could be usi...
[3 replies] Last: Great! That helps thanks to both. (by chris)
best database access library for c++?
 
Hi, In your opinion, whats the db access library for C++ that is free (or freely available) and is fairly popular (most popolar??) and is object oriented and...
[4 replies] Last: Helios: They are multi-platform toolkits. Their functionality is centr... (by Zaita)
A lil processing with arrays
 
The aim of the program is to put a 9 digit number in the array, and use functions to increment the number For ex if i enter 123456788 in the array after the p...
[6 replies] Last: How is this useful for a sudoku solver, may I ask? (by jsmith)
A little he*p with string.h
 
string str; getline(cin,str); So I saw this piece of code and I had the following queries ... 1] What does the string keyword do ? Is it like another d...
[5 replies] Last: thank you for posting every one ! (by rockinruler)
qn regarding new library
 
in the tutorial section, it says I need to include the new library like so: #include<new> in order to dynamically allocate memory using the new keyword but why...
[5 replies] Last: Nope. It's standard. I found it in "include/c++/3.4.5/new" in MinGW. ... (by helios)
qn on sorting algorithm efficiency
 
can someone rank among all these sorting algorithms from least to most efficient since I found some conflicting statements about which is more efficient and suc...
[4 replies] Last: Yes - for example, the average case for bubble sort is O(n^2) and for ... (by jsmith)
by Radius
Basic issue related to strings & compiler error.
 
Greetings! I am basically new to C++. After being quite adept at Applesoft BASIC & Pascal , back in the day, it is frustrating for me to seem so clueless...
[6 replies] Last: It might be because the return key is sending a \r, and cin wants a \n... (by firedraco)
error: expected class-name before '{'
 
Hi, we have a problem! The compiler says: error: expected class-name before '{' token even though we use #include "AbstractAirplane.h" Whats wrong? #...
[2 replies] Last: Check for circular #includes. Does SimulationEngine.h include Passeng... (by jsmith)
by g0dwyn
problem w/std::sort_heap
 
Hey all, I'm trying to use std::sort_heap to sort an STL vector. The vector uses a custom data type, so I created a comparison function object that goes lik...
[1 reply] : You need to instantiate the struct. evtcmp() (by jsmith)
Find max and average of multiple values
 
This is an assignment I have to do. Please help, I tried, but have no idea how to do it: Write a program in C++ to find the maximum of a set of values and i...
[4 replies] Last: Do you understand what mahlerfive has said? Its really just a simple f... (by buffbill)
by mason
I am new to game making
 
i do not no enytheng about using c++ eny tips would be of grate help
[2 replies] Last: LMBO! (by Return 0)
by Z24
Can I use a global variable in a library?
 
Hi guys! I have this code: File zts_tlib.h: library header: #ifndef ZTS_TLIB_H #define ZTS_TLIB_H #include <iostream> #include <fstream> #include ...
[10 replies] Last: Great explanation and example, thanks Duoas. However, I fail to se... (by Z24)
by wooyen
How can I know the reason of the failure of a fstream?
 
When I open a fstream, it will fail for some reson sometimes, such as the parent directory's absence. Though I can check the failbit to know this situation, can...
[1 reply] : No. But there are ways to get this information. In Windows, you can c... (by helios)
Calling a function from Shared Library (.so) in c++
 
Hi, I have a .so file created in C++, I need to write another c++ program that call methods of this shared library. Any Ideas how to do this Thanks in advan...
[2 replies] Last: Thanks for the reply. I am new to c++ programming, can you please poi... (by farooqpervaiz)
Expected unqualified-id before '{' token
 
So, ive spent two days on this simple code, and i can't seem to figure out what "Expected unqualified-id before '{' token" means. here is the code: #i...
[15 replies] Last: Whenever I see numerical literals where character literals would be mo... (by helios)
Expected ';' before string constant
 
So i wrote this program to be sent as a practical joke, and ive reduced the errors to this:"Expected ';' before string constant" there are 3 of them and i dont...
[8 replies] Last: No. You can only store a numerical value in an int. (by jlamothe)
How to instantiate a Vector b4 using it....
 
Hi, I've a simple class MailBox, in the .h file I've declared a vector vector<Message> _emails; . The class includes a method print() which seeks to iterate ov...
[5 replies] Last: Thanks lads... some good points to bear in mind helios like d direct r... (by Pat Nevin)
How do u add text to an ostream&
 
Hi I've written a simple class Message which is meant to be an Email, Ive a print method which write to an ostream& file but I want to append the text to this f...
[2 replies] Last: Thanks you helios that was exaclty what i was looking for, much appric... (by Pat Nevin)
Compiler discrepancy between DevC++ and VS2008..
 
Hi there, I am new to programming and recently had an assignment to create a function that would delete the repeated characters in a character array. Beside...
[4 replies] Last: You do know that some of your do while loops would be better replaced... (by mindsaber)
how to get OS parameters
 
I am wanting to write a debug tool and I am stuck on one thing: How do I obtain the OS parameters (ie platform, version number etc)? Any help/advice appre...
[9 replies] Last: http://predef.sourceforge.net/preos.html Oh, god. I think I need to... (by helios)
November 2008 Pages: 123... 11
  Archived months: [oct2008] [dec2008]

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