General C++ Programming - January 2015 (Page 6)

Using a class member directly in the header file
 
Good afternoon, I'm trying to use a class member to initialize the dimension of a matrix. I have two issues. Here is the code (.h) simplified : #inclu...
[1 reply] : Template parameters should be known at compile-time. You cannot choose... (by MiiNiPaa)
Trying to understand the logic behind creating shapes
 
I just started doing some object oriented programming and I've run into some trouble with creating shapes out of text. I'm trying to understand the logic behind...
[3 replies] Last: @Tresky are you joking. what do you mean by algorithm. every program f... (by sujitnag)
Calculate steepness or incline from 3 to 4 points (XYZ)
 
Hello Do anyone have a idea to calculate steepness or incline from 3 to 4 points in a 3D(xyz) point? I'm trying to calculate steepness to determine if i c...
[1 reply] : Hmm. The slope from (0,0,0) to (x,y,z) is z / sqrt(x^2+y^2). To compu... (by dhayden)
by emckai
Compiler & Variable problems
 
So currently I am having issues with two things at the moment. While working on a program for one of my CS classes I used my macbook to compile and run the p...
[7 replies] Last: The fact that you're getting the right answer on Ubuntu is purely coin... (by dhayden)
Understanding the try-block
 
Hello, I'm studying C++ by 2 months and I'm having some problem with understanding the try-catch block in C++. I'm using the book : programming principles and p...
[1 reply] : Suppose func1() calls func2() and func2() calls func3(). func3() throw... (by dhayden)
Logic behind geometric shapes- diamonds
 
So I've found this piece of code but I'm having a hard time understanding how it works. Could someone please help me to understand this code? I want to make a d...
[no replies]
by beko
Cannot compile with openMP
 
This is my little program (omp.cpp): #include <iostream> #include <omp.h> int main() { std::cout << "Before" << std::endl; #pragma omp parallel { ...
[13 replies] Last: Alright. Then it's time to practice some openMP for me. Again, thanks ... (by beko)
Enter manually a path in C++
 
Hi guys, i would like an help about putting manually a path in my code. This is what my code should looks like #include <iostream> #include <fstream> #inclu...
[2 replies] Last: thx a lot for the help :D (by vanillarainbow)
Building a matrix with a specific dimension
 
Hi there, I would like to initialize a N-dimensional matrix by specifying the dimension N. To be clearer : if N=2 I use to do that : std::vector<std::v...
[2 replies] Last: Thank you for your reply. Seems crystal clear. (by Crocoduck)
Find first 10 words and last 10 words of a string array
 
Hi everyone, I got a homework that require to count number of words in a text file and also display the first and last 10 words of the text file to the console....
[2 replies] Last: Since you're reading words, and words are just groups of characters se... (by tipaye)
by asrebo
identifier before function call
 
what is the meaning of identifier before function call in this example? i mean that in syntax context // Create a stack-allocated handle scope. Hand...
[2 replies] Last: There are two possibilities: One: isolate is the name of a type Ha... (by JLBorges)
OpenCV - Opening and closing webcam
 
I feel a bit dumb asking this silly questing. I am trying to switch between 2 states, and the event that determines which state i am in is based on the key i'v...
[7 replies] Last: while(true){ if( cap.isOpened() ){ //avoid reading from an unopene... (by ne555)
Big C++ by Horstmann
 
Anybody have the link to the solutions of the odd numbered review exercises of Big C++ 2nd edition by Horstmann? His old link (http://www.horstmann.com/bigcpp/...
[1 reply] : Worth mentioning that people on programming forums really don't like j... (by Tresky)
functions messing up!
 
Im trying to use gotoxy which was removed from conio.h apparently. #include <stdio.h> #include <conio.h> #include <windows.h> void gotoxy( COORD c ) {...
[2 replies] Last: ^^ What he said. (by Tresky)
program working on online compiler but not on codeblocks
 
This program works on an online compiler but force closes on codeblocks after entering the elements. Any suggestions what is wrong ? #include<iostream> usin...
[6 replies] Last: if you are looking at the program you are not looking at the compiler.... (by Little Bobby Tables)
constructor
 
what is importance of one argument constructor with example?
[2 replies] Last: Student(int rollno=24) I don't think that having a default value par... (by Tresky)
vectors
 
I'm not sure what i am doing wrong, can someone please let me know. im trying to print the prime numbers, so i put the numbers into the vector and then erase...
[3 replies] Last: Thanks keskiverto and sorry for not reading up before. (by danishs23)
program crashes
 
if (input == '(') // '(' has lowest precedence in the stack, highest outside mystack.push(input); else if (input == ')') while (!mystack.empty() a...
[6 replies] Last: Got it working. This was all caused by indentation errors by not using... (by cppnoob25)
Switch DNA Strand?
 
How do I convert dna from an array to complementary dna. void print_reverse_complement(const char dna ) { the above function will convert DNA to Complemen...
[1 reply] : Start with a function that returns the complement of an individual nuc... (by dhayden)
Question about organizing class with many methods
 
Okay so i'm working on a small game just for learning purposes. Since the game is multiplayer, I have many things to manage. For example, I have a few dif...
[3 replies] Last: First instead of using namespaces on enums, use enum classes, they are... (by poteto)
January 2015 Pages: 1... 45678... 24
  Archived months: [dec2014] [feb2015]

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