General C++ Programming - July 2011 (Page 3)

Calculating prime numbers
 
Hello, I have recently begun working on the Euler Problems and need to find prime numbers from 2 up to a user selected number. The code I have so far is: ...
[4 replies] Last: Hi, below I provided the general C code to print prime numbers from 2 ... (by girish1026)
File Management
 
What I would like to know is how to use C++ to manage a directory and the files in the directory. I would like to have it create folders based on a specified cr...
[2 replies] Last: Thanks, I'll repost in the windows forum. (by simbiote3)
[HELP] Linked List
 
So I have a linked list assignment for my C++ class, I have it pretty much done but I am having trouble with the provided test files. When I try compiling I ge...
[no replies]
UDP recvfrom not blocking? help
 
I am writing some simple client/server code using UDP. The program works fine, but if I only start the client, the recvfrom method does not block. However, when...
[1 reply] : Let me try to understand and maybe just a guess. When you do a sendto(... (by sohguanh)
by NickT
Generating new value at every execution (when it shouldn't
 
Hi again, So I've ran into another snag with my message digest code. It generates new, very slightly different values every time it's ran with the same, unal...
[4 replies] Last: You mean the whitespace or the actual space character 0x20? If you'r... (by NickT)
sort error: descending instead of ascending order
 
Hi, I have made a small mistake in my code and cannot find what I did wrong. The code is meant to display the second output in ascending order (1-10, a-z)...
[1 reply] : Read these two lines closely. if (currentMin < list ) { c... (by jsmith)
Heap Corruption with triple pointers
 
Hello - I am having trouble deleting a triple pointer. Below is my code. complex <double> ***arr; [Fill in arr] for (int n1=0;n1<N1;n1++) { for (int n...
[1 reply] : Heap corruption isn't caused by delete . The problem is you are ste... (by Disch)
Expression must have class type error
 
So, I'm new to Windows programming, but have a base of Console C programming, VBScripting for web and simple Micro-controller C++ programming (PIC 18f series). ...
[no replies]
Binomial Coefficient
 
This code is suppose to return the binomial coefficient of two numbers. It works fine for smaller values but goes haywire with larger values. Is there something...
[3 replies] Last: use double values instead of integers, also you need to use recursion.... (by paulmcco)
by Disch
Issue with friendship in a separate namespace
 
Hey guys, I'm having problems declaring a friend function in a separate namespace. Here's a simplified example of what I'm trying to do; namespace ns...
[19 replies] Last: Oh, I see now... I didn't know what a build system is -> http://en.w... (by m4ster r0shi)
by gizzmo
templates and inheritance
 
Hi, I can't understand why I get an error when I try co compile #include <iostream> template<typename T> class A { public: A() {std::cout << "constr...
[1 reply] : This is due to the fact that Apublic, Aprotected, etc may not exist in... (by Disch)
Maximizing CPU usage
 
Hi. I'm writing code to carry out a big matrix multiplication and I'm splitting up the job to the 4 CPUs I have available. I'm finding that I'm only using about...
[2 replies] Last: Thank you!!! (by pbajaj5)
Adding dimensions to arrays during execution?
 
Hello all! I am writing a program that uses a two dimensional array for storing thousands of strings. It imports two files (a reference and something to be c...
[1 reply] : You would probably be better served using a different base structure, ... (by Duthomhas)
by xwilx
invalid conversion from int ** to const int **
 
Here is a question which makes me puzzling and would appreciate if anyone can give me some insight. For the following function f1 void f1(const int *p...
[3 replies] Last: you cant convert const int * to int * !!!! if you want do this you mus... (by ahura24)
Sorting information from array with Operator Overlaoding
 
I have a program in which I take information from a csv, store it in an array, and display it. I want to display the information a second time but this time ...
[2 replies] Last: webJose, I inserted a sort function now that I used previously and st... (by MarkLeonis)
by Null
std::exception problem
 
Hi, I'm writing an exception class but the compiler keeps complaining about it's destructor: class myexception : public std::exception { public: std::string ...
[3 replies] Last: @ahura24: there's no problem since what() returns const char * and... (by Null)
LINKEDLIST find the "Kth" Element and Delete it!! (1,2)
 
How can I find the Kth element in this code??(I personally don't know what the author of the book was referring to when he decided to say "find the Kth element ...
[21 replies] Last: I spoke about this issue with my proffesor and she said that the purpo... (by voteboo)
C++ OOP Programming
 
I need help on a tic tac toe game. I am trying to figure out how to switch between player one and player two each turn. char playerMark; // Switch After...
[1 reply] : I guess they want you to pass in something to the getMove() routine. ... (by kooth)
bitwise operations
 
Does anyone have any recommendations of a PDF or article for technical interview questions for c++ bitwise operations? I know its specific, but I am looking to ...
[5 replies] Last: Some bitwise operations : http://graphics.stanford.edu/~seander/bitha... (by bartoli)
May someone check my code why it isnt correct?
 
deleted.
[3 replies] Last: I am not aware of the algorithm you are trying to use (haven't used it... (by Silvermaul)
July 2011 Pages: 12345... 30
  Archived months: [jun2011] [aug2011]

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