General C++ Programming - February 2012 (Page 5)

Will you please help with my trigonometry calculator ?! :D
 
#include <cstdlib> #include <iostream> #include <math.h> using namespace std; int main() { int angle, hyp, adj, opp; double sct, final; cout << "...
[4 replies] Last: Any any aspect of of 0.0 iis a degenerate triangle and you can end the... (by roberts)
Socket programming with C++
 
I have been studying and working with C++ language for sometimes now, but my aim is to use C++ for Network (socket) programming. I have tried to get eBooks on s...
[8 replies] Last: The book "UNIX: Network Programming" by W. Richard Stevens (rest his s... (by roberts)
Heavy use of pointers - Segmentation Faults
 
So I was making an encrypted diary program for fun.. And I have been getting segmentation faults.. I can't figure out where the problem is coming from.. #incl...
[3 replies] Last: Using std::string, you can still access on a single char basis, using ... (by Gaminic)
by vivmen
multi dimentional array
 
Hi All i am trying following code and getting some errors class A { const int x; const int y; const int z; public: ...
[7 replies] Last: Hi you also have other options Blitz c++ library Eigen Matrix c++ lib... (by therockon7throw)
Class inheritance help
 
A project ive been working on became to big, and Ive decided to split it into classes. If you've been around this forum you'll see my 2d array project all over,...
[11 replies] Last: class A{ public: A(); ~A(); void A_func(); }; class B : publi... (by Jikax)
by snova
member templates - access problem
 
Hello Everyone, I am getting compiler "error C2248: 'CTest<T>::m_element' : cannot access private member declared in class 'CTest<T>' ." I don't know why the...
[3 replies] Last: @JLBorges Thanks, but I want to understand the sample using differe... (by snova)
by vivmen
Another Performance check
 
Hi all after my 1'st performance check http://cplusplus.com/forum/general/56290/ i try another one this time i am using AMD Phenom 2 X6 1090T 3.2 GHZ, ...
[5 replies] Last: thanks for your suggestions i will try other possible ways as well to ... (by vivmen)
Dev to CodeBlocks
 
I have been using dev as my IDE, but I have been told that dev is outdated and horrible, so I am starting to try CodeBlocks. I want to run my same programs on C...
[4 replies] Last: thanks -mwindows worked. (by DeadEli)
Question about memory allocation for variables
 
Hello guys, if I have this function in runtime: void foo (int x) { if ( x == 5 ) // or any other sentence return; // or throw something, whatever ...
[5 replies] Last: Some gcc assembler output to emphasize the point: void foo (int x) {... (by Athar)
Need help finishing program please and thank you!
 
Here is an example of what my program should do and print as the out put. But my program is only showing the scores and not per section and not high or low sco...
[no replies]
i cant even count?
 
I have been trying to get this program to work for a long time please assist me, I have really tried everything i know how to do and can comprehend from google ...
[no replies]
exchange sort
 
I have a program that reads a text file then puts the data into parallel arrays, one of student IDs and one of their test scores. I'm having issues with the exc...
[2 replies] Last: My professor has asked specifically for an exchange sort. Thank you th... (by ashhuber8)
How to use .read()
 
I have a file which I'm reading text from and I'm trying to read the file character by character....I'm using the read function to get the character and it work...
[2 replies] Last: That's what I thought too but what I'm getting is just two single quot... (by hopesfall)
Calculating Inverse of a Function
 
Hello, I am trying to calculate the inverse of a matrix using C++. I used to have the functions in the actual code, but that was creating infinite loops by red...
[no replies]
Problem accessing member functions through Inheritance
 
Hey guys. I'm having a problem with an rpg that I have been working on, being fairly new to inheritance. I have 3 character types that I have, each inheriting f...
[5 replies] Last: Thank you guys! That worked perfectly. I'll need to read up more on vi... (by aclark64)
How to convert char to my typedef
 
I have the following typedef: typedef unsigned char myType; Now, I'm collecting characters from a file one at a time like this: while(!sin.eof()){ c...
[2 replies] Last: operator>> works with unsigned chars: #include <fstream> #include <i... (by Cubbi)
Error: [variable name] may not be initialized
 
This is my code, and the error/warning is included. 0001 /* 0002 Randall Hall 0003 CSCE 1020.00 0004 Lab 5 - program 2 0005 0006 C program to display the...
[7 replies] Last: Actually, depending on the point of origin, somewhere between 25 and 9... (by Moschops)
Scope for temporary variables?
 
Hello, I was wondering if I could get some opinions on something, or if someone knows a better way to do this to let me know. I need to make a matrix by multip...
[6 replies] Last: You can do it by using unnamed temporary objects. That is, instead of ... (by vlad from moscow)
memcpy(): why does this work?
 
Hi all, would sb be so kind, have a look at following code and answer my questions (see comments) #include <iostream> #include <string> using namespace s...
[15 replies] Last: [quote=roberts]I don't. If a programmer defines his 2D arrays as being... (by Disch)
Arrays
 
Hi can someone explain to me how the following can be done: exampleArray = 5 even though exampleArray is a 2d array? Ive come across this in some c++ so...
[6 replies] Last: Given the following matrix: (0,0) (0,1) (0,2) (1,0) (1,1) (1,2) (... (by Aikon)
February 2012 Pages: 1... 34567... 43
  Archived months: [jan2012] [mar2012]

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