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

by rocapp
Using Polyline() to draw line segments from a loop.
 
Hi all, I'm trying to use Polyline() to draw lines to the screen. So far I have done my best to do the following: 1) Create a loop that simulates basic Eule...
[no replies]
by doug4
Template Specialization and Libraries
 
Here's my code: read.h: #include "parse.h" #include <string> template<typename T> void readValue(const std::string& str, T& value) { parse(str, v...
[1 reply] : See: http://www.gotw.ca/publications/mill17.htm read.h #include "p... (by JLBorges)
by Zyl
Intentional template redundancy possible?
 
Hello, I'm writing a class Vector3<T> to represent a threedimensional vector with elements of type T. I am doing this as a practice for C++ operator overloadin...
[2 replies] Last: I was thinking the wrong way round. This is much simpler than anything... (by Zyl)
trouble passing vector to function by refrence
 
i need to sort the function and to do that i have to pass it by reference however i keep getting an error. This was a combined assignment so most of the code wa...
[no replies]
Switches with variables
 
Switches have never been a thing for me but my instructor assigned my class some programs that we have to make and 2 of them involve using switch cases. I am tr...
[3 replies] Last: Not sure what approach you took, but one way (probably the best way) i... (by ResidentBiscuit)
by Jt253
Car Instrument Simulator
 
I'm also working on this problem: For this assignment you will design a set of classes that work together to simulate a car's fuel gauge and odometer. The c...
[4 replies] Last: I still need help on this problem. How can I stop the infinite loop? a... (by Jt253)
by Sobo
Can you explain this please..
 
please explain that why this program will give output of 2...According to me, it should give 0 #include <iostream> #define prod(a, b) ((a > b)? a*a : b*b) i...
[8 replies] Last: http://en.wikipedia.org/wiki/Undefined_behavior (by Computergeek01)
by tmason
calculating the inverse view matrix from computer graphics...
 
Hello, I have a quick c++/opengl graphics related question. How do you calculate the inverse view matrix? Is that really just the inverse of the view/c...
[2 replies] Last: Hello, Thank you for the nice writeup. I need the inverse view matrix... (by tmason)
homework help please
 
fixed!
[4 replies] Last: The last code you wrote looks correct. It's also much better than the ... (by Zyl)
Header problems
 
Hello! I'm making a program with lots of headers, but it doesn't link correctly, displaying the "not declared in this scope" error. How should i #include those ...
[3 replies] Last: Using extern keyword in header file is the best option! (by hakeris1010)
Run Time Analysis QUESTION
 
Example Below: Sum = 0; for(i=1 to (n-1) for(j=1 to (i-1) Sum = Sum + i*j; I am trying to find the total. So far i have... Line 1 = 1 Line 2 = n o...
[no replies]
How to improve my code
 
So I need some tips on how to improve this code by making it shorter or so basically you have to input a number from 1-100 and display it's name. http://past...
[2 replies] Last: Thanks man! Really appreciate it and I would really keep in mind on no... (by tajaros)
I am desperate, please help.
 
Please help me i am desperate. I am doing terrible with this assignment. Here is the instructions. it is two separate parts 1st part is this Create a method ...
[7 replies] Last: Hi Seeing what you wrote so far would definitly be useful... Are you... (by HalfNOoB)
When is an Assumed Median sort faster?
 
I have an array of pointers to structures and I need to sort that array multiple times based on various structure elements. For example: read 300 elements from...
[10 replies] Last: Thanks, I think the preemptive code approach might be the best alterna... (by PapaGeek)
by You
How to pass integer parameter to main(int main)?
 
//This program demonstrates a funcion with three parameters #include <iostream> using namespace std; //function prototype void showSum(int, int, int); ...
[2 replies] Last: //This program demonstrates a funcion with three parameters #include ... (by tipaye)
by Jt253
NumDays Class
 
I have a program here to which i have to represent a certain number of work hours into how many days of work that will be. 8 hours is 1 work day. Here is th...
[3 replies] Last: Can you post your fix? And please use the code formatting tags. For c... (by tipaye)
Initializer List in C++
 
Hi , how to create an initializer list for an array-like class ?? The class is using a template by the way ...
[6 replies] Last: No, this is not possible in C++03. Create variable and then add needed... (by MiiNiPaa)
by GTR4j
Nested Loops ~ Need help!!!
 
I've literally spent an over hour just trying to print this 100 times but I can't seem to figure it out. Any help would be greatly appreciated! Thank you. #...
[2 replies] Last: All I really see it at very end of code you should need a return0; a... (by sly858)
by DELB
Prime Numbers Help
 
Hi, #include <iostream> // note the use of function prototypes bool isDivisible (int number, int divisor); bool isPrime (int number); using namespac...
[3 replies] Last: see this simple program to find prime numbers: http://www.easycppcodes... (by easycppcoder)
How to determine a special character in a string?
 
I have to make an email validation program and i am halfway done. I only have one more problem, consider the ff. example: Enter email: myemail.@something.com /...
[4 replies] Last: Thanks, i got it. but i can't seem to get this to work: for (i = 0;... (by Zanmato)
February 2015 Pages: 1... 1920212223... 26
  Archived months: [jan2015] [mar2015]

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