General C++ Programming - February 2015 (Page 13)

by tmason
Faster to create new variable or reuse existing one for math calculation?
 
Hello, So I have a question that sprung out of curiosity as I was programming; is it better to reuse an existing variable or create a new variable for the fo...
[1 reply] : Hi, the first is equivalent to the copy constructor. glm:mat4 newVi... (by Mathes)
Overload >> operator using both character and integer
 
Hi all, I'm trying to overload my >> operator for a dynamic array class. My code works, but I would like to alter it so that my function can accept another typ...
[9 replies] Last: Great. Thanks everyone! (by Macalay7777)
Beginner C++Programming - Functions?
 
'Write a program that uses three functions: DisplayInstructions() is a function that takes no arguments and returns no value but simply displays the instructio...
[no replies]
returning by reference from function
 
#include<iostream> using namespace std; int &fun() { int x = 10; return x; } int main() { fun() = 30; cout << fun(); return...
[1 reply] : The behavior is undefined, anything can happen, including the output o... (by Cubbi)
Trying something
 
The program prints numbers between 1 and 16 using a for loop can you help convert it to a do...... while and while loop. #include<iostream> { int x; for(x=1...
[1 reply] : If you want the program all coded, you will get nowhere. http://www.cp... (by iQChange)
OpenMP parallelisation of linked list
 
Hello friends of C/C++, I am a beginner in OpenMp which I use to parallelise my numerical simulations code. I am working on particle based simulations with a n...
[no replies]
Database Join OPERATION
 
Hello, i have taken an university course called Database Systems even though i don't even have an idea about how to use C++, homework's statements are as shown ...
[1 reply] : Please do not post the same topic multiple times. http://www.cplusplus... (by Zhuge)
Dijkstra’s algorithm c++ coding explanation ?
 
hi,this code describing the work of Dijkstra’s algorithm,but i dont know how it works,anyone can explain please ?! or at least explaining the main codes meani...
[3 replies] Last: thanks for the notes (by Fisher86)
c++ program to implement bubble sort
 
4.)Design a C++ Program to implement the following functions: a.)the function for bubble sorting : int bubblesort(int*a,int size). b.)the function for merg...
[1 reply] : Please note, that this is not a homework site. We won't do your homewo... (by MiiNiPaa)
Question about domain of problem
 
Disclaimer this is homework, but just s small piece of a larger problem. I have built my code to get gcd... using bigint What I need help with is making sure...
[4 replies] Last: Sorry, but I am not understanding. but is 2^1 through 1^500 1^500 t... (by TheIdeasMan)
Questions
 
Hi, everyone! There are 2 questions at the end, check it out. Thanks. #include <iostream.h> #include <string.h> #include <stddef.h> const int MAXNAME...
[1 reply] : Hi, what " pool + p" will return, because "pool" is the name of arra... (by TheIdeasMan)
#define
 
format of #define token value like this // I know about in details but in header file we use only #define H_File_name [no value] my question is what is ini...
[4 replies] Last: thnx both. that means #if not work here. #define token value #ifdef... (by sujitnag)
by emckai
delete
 
delete
[no replies]
Magic Square Help?
 
I'm a bit lost as to why my program is getting an error code as it runs. It will compile I get an error memory violation code. The goal is to let the user enter...
[3 replies] Last: debugger, backtrace valgrind is quite useful too. By instance, it dete... (by ne555)
Should I use POSIX or OS default functionalities?
 
What should I use? Why? What are the pros/cons of using it?
[2 replies] Last: I actually use boost for a lot of things. But sometimes it's too heavy... (by iQChange)
Killing a program using an input rather than ctrl+c?
 
I have a program that i am trying to terminate using a input of "quit" i have called the exit () function in my program but i don't understand why its not worki...
[1 reply] : Please, do not double post. It clutters forums and spreads attempts to... (by MiiNiPaa)
Nice little exercise
 
I ran into this during my own programming. I just wanted to share it with you because it looks interesting. Not too hard, but a nice mental exercise for those...
[3 replies] Last: Use pointer to data members: #include <iostream> struct Base { ... (by prestokeys)
by Cobryn
Help with this error check please!!
 
This program is working but the Error Check is kicking my butt for some reason because it detects the error but it doesn't give me a chance to retry well it doe...
[6 replies] Last: Well, do you have another idea for doing the error check instead of w... (by Cobryn)
Parsing #IF Directive
 
Hi, I need to write a script which parses #ifdef directive. I'd need to support different types as below. My object is to detect the FLAG out of the different...
[4 replies] Last: Hi, I'm sorry for not explaining my objective correctly. I edited the... (by jared181)
homework help please
 
thanks everyone.
[7 replies] Last: thank you all for your input. (by justhappy)
February 2015 Pages: 1... 1112131415... 26
  Archived months: [jan2015] [mar2015]

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