General C++ Programming - November 2008 (Page 5)

Cannot compile -mthreads
 
Using GCC 3.4.6 on redhat linux Trying to compile an application using the -mthreads option. G++ throws an error on the Makefile from cc1plus that it doesn't ...
[2 replies] Last: -DTHREAD_SAFE (by jsmith)
by JomarC
Templates
 
Hello, I´m having problems with templates. I will explain my problem(sorry for my bad english). I have a template like this: template<TV,TR> And a ...
[8 replies] Last: Um... Why are you passing an object of type T to a method of class T? ... (by helios)
text file will not read
 
Using g++ on a Dell Linux box Redhat 4.2.1 I have an application running two threads. In the one thread I receive a table, I write a text file that now ...
[2 replies] Last: I'd like to see the binary contents of the file, possibly in hex. Als... (by helios)
-
 
-
[4 replies] Last: We can't delete posts...he edited it to have a '-' as the title and bo... (by firedraco)
about enum
 
dear guru, here am i again i need some help from you please. i m writing a program that i should read from a file a tvprograms. the file is given with this f...
[8 replies] Last: thank you very much i got now i change my bool checkInput to void and ... (by tukuniata)
c++ windows.h header file
 
hi frnds i want windows.h header file. i want to download header file if can help me plz help me...........
[4 replies] Last: Get yourself a modern compiler. http://www.turboexplorer.com/cpp (It... (by Duthomhas)
Storing a varaible type
 
Is there a way to store a varaible type in a varaible? VaraibleType Type1 = int; VaraibleType Type2 = float; Type1 a = 1337; Type2 b = 3.14; Is...
[1 reply] : http://www.cplusplus.com/doc/tutorial/templates.html Templates impl... (by Zaita)
Priority queue top and pop
 
I have a question about the pop() function for priority queues. If I have multiple items on the same priority, will using pop() delete all of them or the oldest...
[2 replies] Last: pop() should remove only the topmost element, regardless if there are ... (by mahlerfive)
Sementation fault - memory problem?
 
Im with a problem to run a C program, maybe you help me to find the solution. Its a simple code, but uses a lot of memory. One matrix for example have 10 milli...
[1 reply] : When you say you tried to use malloc and free, how did you define your... (by mahlerfive)
Need Code
 
HiAll, I need the C++ code for single layer perceptron learning . Thank you
[2 replies] Last: i wonder if that topic/article the most referenced/linked (lol) (by simply thunder)
by Corpus
Binary operators as friends - why?
 
Hi all I have read that binary operators, e.g. operator +, sould be implemented as global (friend) functions whenever possible. Why is this so? One argume...
[14 replies] Last: The project I work on has upwards of 50 developers and 1,000,000+ line... (by jsmith)
Random numbers
 
How can i generate random numbers(from 1 to n) without using any inbuilt functions like rand().
[3 replies] Last: Boost has a few. http://www.boost.org/doc/libs/1_35_0/libs/random/ind... (by Zaita)
Multithreading with the boost C++ libraries
 
Hello, I posted awhile back about multithreading and was directed to boost.org. What I've read has been good, and I've been trying to get it work for awhi...
[8 replies] Last: Lines 31 and 32 of the sample I posted. (by Zaita)
vectors and const_reverse_iterator
 
This is my example code: #include <vector> std::vector<int> v; int main(int, char **) { std::vector<int>::const_reverse_iterator iter = v.rbegin...
[no replies]
Selecting one of two random numbers.
 
I need to select one of two random numbers in my program. I was originally going to put the two values in an array and srand to pick one, but as I'm only using ...
[4 replies] Last: Cheers, Baz. I'll give it a shot. (by Sophisto)
UPPER TO LOWERCASE
 
Hey the following code works in counting vowels consonants and spaces of a given file but how do i convert an uppercase letter to lower? This must be a simple...
[5 replies] Last: I prefer transform(): #include <algorithm> #include <cctype> #in... (by Duthomhas)
String Arrays
 
I need a little help to get me going on how to start this program. I know how to create a string array, but I'm having trouble getting the overall structure ...
[3 replies] Last: You could go through the tutorial on this site, it covers most of the ... (by firedraco)
by altrim
simple program problem
 
hi everyone i am new to C++ need help; //Write a program that for 5 books with this atributes //books name //authors name //publishing year //book price ...
[3 replies] Last: Get the year from the user, then look for books that have the same yea... (by firedraco)
Whats the problem in my coding
 
I want to write a program to input principle amount and time . if time is >10 yrs.Calculate the simple interest with rate 8%.otherwise calculate it with 12% per...
[3 replies] Last: I think you are working in turbo c++. correct line 10 like this: if(t... (by vipul mehta)
function returning a string
 
Hi I am trying to write a class with a member function that returns a string. I have this but i get a segmentation fault: main.cpp #include <iostream> #in...
[7 replies] Last: string provides operator+ that takes a const char* and returns a strin... (by jsmith)
November 2008 Pages: 1... 34567... 11
  Archived months: [oct2008] [dec2008]

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