General C++ Programming - September 2012 (Page 3)

Making a program loop.
 
I would like make my program so if the user enters a wrong value, the program will loop back to were it prompted you to enter the value. Thanks
[3 replies] Last: You should use a loop. For example do { // here you code } while ( s... (by vlad from moscow)
Passing a 2D array of Structs by referencePassing a 2D array of Structs by reference
 
SO im pretty new to c++ and im trying to pass a 2D array of a struct type by reference to a function. As far as i know they are automatically passed by referenc...
[3 replies] Last: Remove the first brace { void function(balloons bArray ) { (by vlad from moscow)
glibc detected *** ./index: free(): invalid pointer
 
Hello everyone, I was making a relatively simple program to index a .txt file for class, and I got the following error trying to run it. *** glibc detected ***...
[2 replies] Last: I am not using delete anywhere in my code, neither am I creating point... (by dragoonts)
Iterators past limits question
 
Hi, I'm having trouble finding documentation about iterator operations when they go too far. In particular, say I want to advance an iterator by 50 or -50 typic...
[1 reply] : (1) Yes (2..5) Something buggy. No STL algorithm will forbid you from... (by Duthomhas)
operator>> not found error
 
So, I was building this code recently and I got some errors (seems obvious right, hold off on the sarcasm for awhile please). Anyway, the errors specifically we...
[6 replies] Last: Ok, I've fixed the issue. The problem was that my input operator funct... (by Woody1193)
guessing game do while loop
 
// Inlcudes #include "stdafx.h" #include <iostream> #include <conio.h> #include <ctime> #include <cstdlib> using namespace std; // Main Function in...
[1 reply] : wow nevermind fixed it, while ( num = num20 had to be change to while... (by Reaper1)
by vextes
Linked list dequeue
 
Hello, I am trying to create a singly linked list implementation of a stack, but I keep getting strange errors that have to do with my dequeue function, but I h...
[6 replies] Last: If you call dequeue on an empty Queue, you're going to dereference a n... (by cire)
Sudoku Help
 
Hey guys, I've posted here before, and the only time I EVER come here is when I've been working on a program for at least 3 hours straight and I end up being st...
[4 replies] Last: Yes they are constants. Both numRows and numCols = 9. I figured that... (by H0m3r0w)
Difference between two dates with overloaded minus operator
 
I have to input two dates, then subtract the earlier date from the later date, and output the number of days that is the difference. So for example April, 18 20...
[5 replies] Last: but the output for the interger subtraction is garbage. Outputs like ... (by clanmjc)
by mmac
cout issues
 
when i run the program, the user is prompted by my cin.. but no matter what they put in, nothing comes out. help! #include "GoingBroke.h" #include <math...
[13 replies] Last: Look at the warnings in @TheJJJunk's e-mail. The statements without e... (by doug4)
by obay
question in hugeint class
 
how to make (/)operator? // Fig. 11.23: Hugeint.cpp // HugeInt member-function and friend-function definitions. #include <cctype> // isdigit functi...
[2 replies] Last: I agree about using code tags. You can use the "<>" button on the For... (by doug4)
Help needed
 
This is what i have written so far : #include<iostream> #include<cmath> using namespace std; int main() { int n; cout<<"Please enter an integer :"<<endl; ci...
[3 replies] Last: The code that @Aceix provided is a bit of overkill. However, he (or s... (by doug4)
STL allocator vs Operator new
 
Hello, I'm confused about the difference between the STL allocator and the Operator new. In the book I'm reading it's solution to "find a way of getting and m...
[3 replies] Last: You will no doubt have noticed that the STL containers take an allocat... (by kbw)
[HELP] Chrome Password Stealer - Code
 
What errors are you getting exactly?
[4 replies] Last: The code is not C++ , it is C++/CLI . If you took the code from l33... (by closed account z05DSL3A)
Reading from a file
 
I am in a c++ class and I am having problems reading from a file. I am trying to return specific parts of a line EX: You have won 10 games.(only load the int...
[3 replies] Last: Thanks! I appreciate it!! (by mhaggard)
Bad file descriptor in multi thredding environment
 
I am running 3 Applications 1. proxy 2. CommandServer 3. Data server Multiple proxies are running on different machines and all will connect to single comm...
[1 reply] : It's impossible to work out what's going on without a better understan... (by kbw)
compiler declaration order issue?
 
Have an error I can't figure out how to work around in Ref_List.h on line 15. Here is the code. main.cpp #include "Sync_List.h" int main() { Sync_...
[7 replies] Last: I was trying to get around an issue where Ref and Src rely on each ot... (by clanmjc)
stuck on 1 problem
 
// Includes #include "stdafx.h" #include <iostream> #include <conio.h> using namespace std; // Main Function int main() { int year; int charge; ...
[2 replies] Last: thank you it worked. (by Reaper1)
In/Out Ports User Mode
 
Hi! I need make in/out ports in user mode, using language C. Example: inb 379H (I need to known status paralel port). How Can I do it using language C? Th...
[1 reply] : http://www.mindfiresolutions.com/port-talk.htm (by TheJJJunk)
by KuPosu
random odd numeber generator
 
void render() { int N; srand (time(NULL)); N = rand() % 10 + 1; glClear(GL_COLOR_BUFFER_BIT); glViewport(10, 10, 640, 480); rosette(N, .66f); ...
[1 reply] : if (N % 2 == 0) //num is even (by TheJJJunk)
September 2012 Pages: 12345... 32
  Archived months: [aug2012] [oct2012]

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