General C++ Programming - July 2014 (Page 19)

Why infinite loop?
 
Hello. I appear to have fallen into an infinite loop.Why is it? int main() { char buffer = {0}; int fh = _open(FILENAME, O_RDONLY); ...
[10 replies] Last: Ahh cout << pc1++; Will print out characters until it finds '\0' So ... (by Lachlan Easton)
by xismn
Exceptions thrown during initialization
 
Hello, It's embarrassing how little I know about exceptions - in an attempt to get smart, I pose this question. How exactly would one go about throwing an exc...
[8 replies] Last: @Cubbi, that changes my perception of exceptions entirely, which is ex... (by xismn)
by manojg
returning address of a local variable
 
Hi, I know that this code is wrong because it returns the address of local variable which no longer exist after function: int *f1() { int x = 2; ...
[6 replies] Last: When a function returns a value, it is not related to memory: it has n... (by Cubbi)
Iterating enum and matrix issue
 
Hello I'm very new to arrays and matrices, I really don't know how they work just yet. Here I have an example that I would like some explaining. 1)Create ...
[no replies]
3D Array as 1D array?
 
How would I go about creating a 3D array using the "new" operator? I noticed that I could do: int* array = new int[ width * height * depth ]; Which is t...
[12 replies] Last: http://ideone.com/f8Q7VN What you've created isn't a 3D array. Ah i... (by closed account 10X9216C)
if statements
 
I am writing some code. I need an if statement that basically states if a digit does not appear in this span of 80 characters, you will need one. I am curre...
[1 reply] : Please don't crosspost the same message to multiple forums. http://ww... (by cire)
My program crashes at times
 
My program is crashing here is some debugger information. I have highlited in bold where it crashes. What is empty_rep_storage can anyone help me fix this error...
[1 reply] : Fixed the issue it turns out if you click on a listbox it will still c... (by danielmccarthy)
HOW CAN I USE BINARY TO C++
 
helloo...actualy I am trying to code this thing...will anyone help me..?? But, it failed..Where can I get the recursion for binary..? #include<iostream> #inc...
[15 replies] Last: You could do something like: unsigned powerOfTwo = 1; unsigned deci... (by giblit)
what is the error in this c++ code?
 
#include<iostream> #include<string> using namespace std; class personType{ public: void print() const; void setName(string first, string last); string ge...
[2 replies] Last: http://www.cplusplus.com/forum/beginner/137720/ Do not double-post. (by mutexe)
Error when looping
 
Hello, When I run my code and it loops with the do-while loop because the user decided that the information he or she has entered was incorrect the code is s...
[2 replies] Last: That worked great! Thank you. (by MANxBEARxxPIG)
by judo11
How this C++ program works and how to trace it?
 
Guys I really want to know how this program works. Please explain this program to me because I don't understand its variables and their respective task. Please ...
[2 replies] Last: this whole code has two parts to it. it only executes one of them. T... (by cire)
Initialization of maps
 
Hi. How are map variables initialized?cOULD SOMEONE PLEASE EXPLAIN THE FOLLOWING CODE TO ME? // accessing mapped values #include <iostream> #include <m...
[2 replies] Last: mymap["ali"] returns a reference to the mapped_type (the second argu... (by dhayden)
by danzal
If i ask user to input how do i remove the command ?
 
#include <iostream> #include <iomanip> using namespace std; int main () { int md, age, ctr ; double charge, avgchg, totchg; cout << "Enter id no :...
[1 reply] : You are using cout for two purposes: (1) to prompt the user for input ... (by dhayden)
SYMBOL CARET
 
Hello, I wanted to ask a question? Is the symbol "^" or caret is a valid operator in c++? Reason? As for me, I think it is valid, because the symbol itself rep...
[3 replies] Last: The ^ is the bitwise XOR operator (exclusive OR) . A bitwise operator ... (by TheToaster)
Class and operator
 
Hello everyone I need a help to write some codes. I need to create program which counts amount of cats, identifies ID, identifies parents of the cat. ...
[1 reply] : Start from http://www.cplusplus.com/doc/tutorial/classes/ Remember: ... (by keskiverto)
How can I transfer selected values from an inFile into an outFile?
 
Hi. My assignment asks me to read inputs from a certain file which has data as shown below: Date Time, Price,Volume, Value, Condition 07/05/2...
[1 reply] : I didn't read your code, but from what you output is and is supposed t... (by Yay295)
by twesna
Looping Program Help
 
I've been having some problems with my program. Basically it is a bank menu where the persons balance is initially $0.00. When the user enters a deposit or with...
[3 replies] Last: I think of a bank balance as more of a running total of how much money... (by wildblue)
Undefined Reference to Header Functions For Hardware Programming
 
Hi, I am looking to program a digital to analog converter to output voltage on 12 of the available analog channels. I am an novice-intermediate programmer but c...
[1 reply] : http://www.cplusplus.com/forum/general/113904/ > Why is this section ... (by ne555)
by TRH123
Bubble sorting help
 
i have this program as an assignment for a class, and i need help with the bubble sorting, and the double attackspeed constructor, thanks :) --these are the in...
[1 reply] : Should make your question more precise, no one is going to want to rea... (by closed account 10X9216C)
Typedefs automatically imported in header files
 
I recently noticed that I don't need to include the required header files inside header files that I have written myself. As as example, GLuint is defined usi...
[6 replies] Last: That makes perfect sense, thank you everyone :) (by Sythical)
July 2014 Pages: 1... 1718192021... 26
  Archived months: [jun2014] [aug2014]

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