General C++ Programming - February 2014 (Page 7)

how come header variables are not recognized in its cpp file?
 
I declared 3 private variables in header file. I try to access one of the variable in its corresponding cpp file but I get an error message saying it's undef...
[4 replies] Last: Thanks Luc Lieber. I overlooked it. (by SangHan)
Padding zeroes on to a binary number
 
The following piece of code is supposed to output the binary representation of a given integer and it does exactly that. However, if the given integer is 2, the...
[2 replies] Last: #include <stdio.h> #include <math.h> const unsigned bits = 4; void ... (by cire)
Error Message w/ Multithreading
 
Hello Everyone, Thank you for your time here. I need some assistance with multithreading for a homework assignment. I'm able to successfully use the _begin...
[3 replies] Last: Sounds good, thanks for the advise NT3. I have it working now. Cheer... (by rkrauss)
by Dkob1
Cell Phone Usage Charges Project
 
Is this how I should start my project??? / / [ Y o u r Name ( s ) ] / / CPSC 1 2 0 / / P r o j e c t # 1 / / Due [ Due D a t e ] # i...
[1 reply] : You should start with what your professor provided. //[Your Name(s)]... (by giblit)
Best Platform and Languages...
 
I am a Network Security major with very limited programming skills: I would like to ask a general question on this forum, and I would appreciate any knowledg...
[4 replies] Last: Thank you for your help! I really appreciate your time and answers. (by closed account 36RMoG1T)
C++: Calculate average from file containing array of numbers?
 
I have written two separate programs; Program 1 calculates the average of an array of numbers which has been hard-coded into the program. Program 2 reads an arr...
[7 replies] Last: Also, suppose we wanted to calculate the percentage difference for eac... (by jonbonjovi)
Issue with Classes and Chars
 
I'm trying to make a more complicated version of this to work, this is the more concise version. int main() { class Title { public: char Name;...
[1 reply] : The Name property is a char not a string or char * . Make it a stri... (by Smac89)
by Nando
How to improve in C++
 
Hi My knowledge in C++ is not where I want it to be. I have done a course objectoriented C++ at the University but I am not one of those guys that pro...
[2 replies] Last: Thank you for your answer. The OJ sites are cool! Ok I will do exer... (by Nando)
by soranz
GetAsyncKeyState() - outside program interferes with it
 
I wrote a small program that uses GetAsyncKeyState() and it works perfectly fine for what I need. The problem is that when I run a certain outside app (not mine...
[no replies]
Hi please help! Some problem with my program
 
#include <iostream> #include <string> #include <iomanip> using namespace std; void updateBankDetails(int a, double b); void printBankDetails(); struct...
[1 reply] : #include <iostream> #include <string> #include <iomanip> using namesp... (by JLBorges)
Help with reading in text file
 
Hi, im trying to make a text based monopoly game and im trying to read in a text file that's contents are laid out like this: GO Red Road 60 5 0 Red Street 80 ...
[1 reply] : Delimit your file with a specific character that doesn't appear any wh... (by Computergeek01)
by Arizal
Need advice
 
Hello to everyone, I'm a new member and need help with my code. Write a constructor that initializes a new inventory object with the values passé as arguments...
[2 replies] Last: Hi and thanks, the cout statement should go before the main() right? (by Arizal)
C++ with SDL2 Framework: Loading .bmp files in same folder in XCode 5
 
I am trying to load a .bmp file located in the same folder as main.cpp etc. but I'm not sure what to input as the resource path so that it picks it up and, when...
[2 replies] Last: After a very long time, it now works. I have to link it with xcode and... (by exitcode)
How can I take out a specific combination of word form a string?
 
Suppose I have to take "100" from the string "1001", whats the process to do it?
[6 replies] Last: the substr is like a "perl" script (by hjye)
'Call to member function x is ambiguous' when calling an overloaded member from a .h file
 
I get the following error in XCode whenever I try to access the member I created 'randomGen' in a separate class in a different header file. I have made sure...
[3 replies] Last: If you pass an int as the first argument it should pick the int versio... (by Peter87)
by ASQ19
error C3861: 'sort': identifier not found
 
[ double temp=0; int index1; //double temp_p_f=0; count_f=0; ofstream myfile20; ofstream grid; // for (index=0;index<nt;index++){ ...
[4 replies] Last: Does it work if you write std::sort? (by Peter87)
Please spot out the error
 
Program executes without any error. My program is suppose to count Total lines Total words Total sentences Total characters from any external txt file...
[5 replies] Last: You shouldn't comment that, you should substitute it with something el... (by S G H)
Remove text from file using C++?
 
I have a text file that has a title and numbers below. I wish to remove the word "Title" and only leave the numbers in the file. In addition, the existing code ...
[no replies]
Modify csv/txt file to include only numbers?
 
I created the following program to calculate the average value of a list of numbers from a csv/txt file. The numbers below can be as numerous as necessary. -...
[no replies]
How to use delete and delete[]?
 
Hi, I'm having trouble using delete. In the third menu, I'm supposed to free the memory of iUserPtr or itPtr, but every time i do that, my program crashes. ma...
[1 reply] : http://www.cplusplus.com/forum/general/112111/ valgrind informs that ... (by ne555)
February 2014 Pages: 1... 56789... 33
  Archived months: [jan2014] [mar2014]

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