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

by manudo
End program instruction.
 
Is there a instruction in C++ to exit the program if a condition is true, like: if (st == 1) printf("The number is one") [INSTRUCTION GOES HERE]; That's m...
[15 replies] Last: Yes, I should have made that clear. Using exit(0) is very much like ju... (by Duthomhas)
Abstract/non-abstract overload/inheritance
 
Hi all, I was stuck on this for a few hours today, until somebody suggested me a solution that turned out to work, surprisingly.. My problem is that neither ...
[7 replies] Last: Thanks a lot clanjmc, I'll get deeper in these to understand what was ... (by Terminux)
Remove and return card from deck
 
This is my code I'm currently stuck in a function in which I have to //remove and return a random card from the deck card dealRandomCard(); And down fro...
[8 replies] Last: What I did was I swapped the random one I made to the top and than jus... (by Jdeleonh)
2D arrays
 
I'm working on a Pac-man game for a school project and have been trying to figure out why my move function will not work, would anyone mind looking at this? I ...
[5 replies] Last: @yoked88 No, I don't mind at all. It seems like an interesting projec... (by whitenite1)
by ejp62
Initialization of compound class at creation
 
Hi, I have searched the net, but did not find an answer to my question, hope you can help me. In case I overlooked some obvious answer, please flame away! ...
[7 replies] Last: Can you indicate a situation where it is better to use arrays rather ... (by Cubbi)
#define delete operator
 
So my question is how to define the delete operator. I was able to do that with the new: #define new new ( __FILE__ , __LINE__ ) //for my own new function...
[2 replies] Last: Cause the new function will become ambiguous. I use define to tell the... (by sasho648)
Trapezoidal Rule
 
I was wondering how to use the Trapezoidal Rule in C++. My homework states this: Integration. Write a program to integrate an arbitrary time-­‐domain sig...
[2 replies] Last: Remember the trapezoid rule is written as follows "((Left(n)+right(n)... (by jquant)
Record Mic and Speaker audio simultanously, Like Skype conversation on a computer
 
Am new to C++. Working on aC++ project recording all conversation happening on a computer like Skype, G Talk. Please someone suggest C++ API to achieve this. ...
[1 reply] : OpenAL. Note that to record anything, the system recording volumes ha... (by helios)
LZMA SDK and Optimization Issues
 
I've found my self in need to use a good compression format library. The LZMA compression matches the bill. I'm using the MinGW64 compiler and when set to compi...
[4 replies] Last: Thank you and your right! Sense this is from within a C library then ... (by closed account 43RGz8AR)
is reference really an alias?
 
i did the following and found out that memory address of a and c are the same. So does this means that both variable and its reference have the same memory loc...
[7 replies] Last: A reference is always another name for some object. The issue is h... (by Duthomhas)
Using CPlex + Boost in VS2010 in debug mode
 
Hello all, I'm stuck for quite some time now on the following. I'm trying to build a project in VS2010 that includes both cplex (and concert technology for c...
[no replies]
Help With code to continue if user answers (Y/y)
 
First off there is a header file that goes with this source code so i'll post that first. ----------------------------------------------------------------------...
[6 replies] Last: Yeah, using toupper (or tolower) is a good advice ;) (by Peter87)
User selection of text files
 
Does anyone know how to open a text file such that the user selects the name of the text file? i.e. infile ifstream; string name; cin>>name; ifstrea...
[4 replies] Last: this information is too much good for me for understanding... (by Bretdde)
farcalloc() Help
 
Hi Guys, Hoping I can get some help with a little bit of code. fptr = (adj far *) farcalloc(OldYear .no_of_adjs,sizeof(adj)); Now, that is using C code. I a...
[3 replies] Last: ... replacing farcalloc with alloc I hope you mean malloc .... (by kbw)
Credit Card Validation
 
So here I am again with a similar question. Valid input is either: xxxx-xxxx-xxxx-xxxx or xxxx xxxx xxxx xxxx . I know the condition looks a bit messy, but when...
[4 replies] Last: A better approach would be to have the user enter the whole thing as a... (by TheIdeasMan)
Why Operator << is defined as a non member function?
 
Hi, Can you please explain why we have to declare the operators such as "<<" and ">>" as a non member functions? Regards, Rajeev N Sambhu
[2 replies] Last: Hi Peter, Thank you very much for your reply. Regards, Rajeev N Samb... (by Rajeev N Sambhu)
by beakie
Qt - Unresolved externals, again
 
I keep getting unresolved externals when I change code that uses Qt in VC++ There is no actual code missing, it relates to the generated code. If I delete th...
[6 replies] Last: If so, it seems as though these files are not updating or rebuilding... (by TheIdeasMan)
Linked Lists
 
I have been reading this tutorial on linked lists (http://www.cprogramming.com/tutorial/lesson15.html) and I got this code from the site, which I put into a com...
[9 replies] Last: @Vlad from Moscow: So I would have to declare a variable that equal... (by MildewyTester)
Urgent Question
 
int monoalphabatic() { char question1 ="please enter the plain text: "; char question2 ="Please enter any key value : "; char plain ="abcdefghijklmnop...
[1 reply] : use code tags please (by Need4Sleep)
compiling only one error with program help
 
#include <iostream> using namespace std; double math(int test1, int test2, int test3, int avg){ avg= (test1+test2+test3)/3.0; } void output (dou...
[1 reply] : I think you mean char lettergrade (double average) { EDIT: Oh and ... (by Angeljruiz)
September 2012 Pages: 1... 1112131415... 32
  Archived months: [aug2012] [oct2012]

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