General C++ Programming - March 2009 (Page 13)

by Morgan
Segmentation Fault
 
I'm getting a segmentation fault whenever i run this code #include <windows.h> #include <iostream> using namespace std; void print(string i) { cou...
[2 replies] Last: check "i" if its coming null as it should be a full path of .exe file ... (by writetonsharma)
libtorrent.lib linkage
 
Hello! I'm trying to link the library libtorrent.lib within Visual C++ Express 2008 and Dev-C++, I believe I followed all the instructions accordingly bu...
[1 reply] : in C++ options you have to fill additional inlcude directory path l... (by writetonsharma)
by bluRry
CMU2 camera Programming
 
helloO ! i am havin some problem on my project on the C programming on this CMU2 cam which is to be mount on a humanoid robot . it acts as it eyes to read a po...
[no replies]
Randomizing Database
 
I am very lost. I am not sure if this a begginer question, or if I am posting in the proper place. Additionally this is NOT a home work project, the example I u...
[no replies]
Quesstion
 
An element in a sorted array can be found in Big-O of logn times using binary search.But suppose I rotate the sorted array at some pivot unknown to you beforeha...
[2 replies] Last: Use the same algorithm, but for the first recursion level add an offse... (by helios)
by pisoir
Overload () depending on rvalue or lvalue
 
I have this problem: I would like to overload () operator in such way, that if it is on the left side it will do something different than when it is on the rig...
[2 replies] Last: Hmm..interesting idea. I was also thinking about the get/set approach,... (by pisoir)
Manipluating with a file!
 
Hi all, I have one problem with reading a textfile. My first solution was: #include <iostream> #include <string> #include <fstream> using namespac...
[1 reply] : Actually...the code is very bad...you have a HUGE memory leak, because... (by firedraco)
Unknown escape sequence ?
 
Hi Guys, I am using a regular expression "^[0-9]\{3\}\.[0-9]\{3\}\.[0-9]\{2,3\}\.[0-9]\{1,3\}"; It keeps saying that unknown escape sequence. The w...
[13 replies] Last: Oops, I am sorry, what I meant to say was compiler. (by kevinchkin)
2-D sub array
 
How to pass a sub 2-D array to a function. For e.g. given the array below 1 2 3 4 5 6 7 8 9 10 11 12 In a function F. I want to access the bot...
[5 replies] Last: Notice that the size of the lowest element(s) must be known and const... (by Bazzy)
by wdth
Division of 2 ints to form double
 
When I run this program with N = 50 and I = 5, it rounds 0.1 to 0. Could someone please tell me why this happens. // Calculate main field probability long ...
[2 replies] Last: there are a couple of ways to do this. You could cast the integers to... (by Disch)
link list
 
hi friends, i have a link list ,i want to sort it in ascending order.plz tell the code.
[1 reply] : Well we aren't a homework service. You can: a) Try to write it y... (by jsmith)
Trying to access a class member function
 
Why will it not let me do this: int leastFrequency = myList .getFrequencyNumber(); or should it be int leastFrequency = myList ->getFrequencyNumber(); ? ...
[4 replies] Last: myList is a pointer to a vector, so you have to use some kind of der... (by jsmith)
modular code
 
can any one help me regarding modular coding i have to do my assignment but i am not clear about this....
[6 replies] Last: sir said that the code it should explain that what functions it is per... (by sara khan)
confusion about the function "getline"
 
I am trying a sample piece of code in the Documentation as following: // stringstreams #include <iostream> #include <string> #include <sstream> using names...
[1 reply] : The VC++ 6.0 implementation is terrible. If you're getting wrong resul... (by helios)
Singleton?
 
I have heard this term used in programming and I would like to know what it is exactly? First of all is it a common concept/term used in C++? Can someone also g...
[1 reply] : http://en.wikipedia.org/wiki/Singleton_pattern In a nutshell, it's ... (by helios)
Random number generator
 
Can anyone please explain me what is happening over here. In this sample code... void generate() { int i, op; srand((unsigned)time(NULL)); ...
[1 reply] : Line 14 on your second piece seeds the generator with the number of se... (by helios)
Destructor
 
I am bit confused with the use of destructor. Please can someone clarify my doubt? Compiler automatically creates a destructor, if it is not explicitely writ...
[6 replies] Last: The node should only free its own data. Its an error for a node to try... (by helios)
Questions
 
I have a list containing many questions about C++...some of them were answered in these forums, but there are always more! 11(ANSWERED). In a division of int...
[10 replies] Last: 16. Is dynamic memory automatically returned to the system when the pr... (by rachitagrawal)
Error in listing out a series of prime numbers
 
i was given a assignment to release the first n prime numbers it turned out to be alright for the first 8 prime number by showing 8 prime numbers. but when i t...
[6 replies] Last: 1) it's a mathetic formulae. it's fixed. 2) that solved everything.... (by windgrey)
Public method access from global functions
 
#include <iostream> class A { public: int a; int get_a() { return a; } }; void access_get_a() { int temp = get_a(); } void main() ...
[3 replies] Last: Thanks Onur! (by n4nature)
March 2009 Pages: 1... 1112131415... 21
  Archived months: [feb2009] [apr2009]

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