General C++ Programming - October 2017 (Page 10)

C++ - Accessing a variable in another class
 
Hello, I'm trying to access a public variable declared in another class, and making a mess of it. Help Please! Regards error: cannot declare variable 'graph...
[2 replies] Last: Hello Enoizat , Thanks for the explanation. I've resorted to plan 'B... (by alonso12)
by MegsD
question on VOID swapping
 
Hello im in an intro to c++ class and we were discussing void swapping which barely made any sense for me. The professor gave us an example that swaps 2 number...
[3 replies] Last: thanks (by MegsD)
meaning of size_t
 
I recently came across this keyword size_t,I read about it in the official C++ documentation but didn't quite able to get my head around it. I don't have much e...
[6 replies] Last: Thank u so much,I got it now :) (by SoumyadeepRoy)
Truncating a float to a specified number of decimal digits (1,2)
 
The ios.precision(n) function rounds a floating-point value rather than truncating it. To truncate a float to an int, we can, of course, cast it to an int. We ...
[29 replies] Last: Comedy gold. (by helios)
Can anyone explain this bit shift to me...
 
Suppose I have two integers. Suppose int a = 7 and int b = 3. I know that a | b will be 0x7 because 0111 and 0011 will be 0111. But why does a|(b <<4) come out...
[2 replies] Last: FUCKING NAILING IT MAN THANKS!!! I totally get it even though 1011 is ... (by Darkpony)
operator overloading
 
Hey guys, I'trying to overload the >> and << operators but a lot errors are coming up and I can't understand a thing. the word "objeto" means a struct; ...
[4 replies] Last: Thanks!! I didn't saw it before (by Lucas Fiorini)
Infinite display loop
 
I am writing a program that reads from a file a list of numbers and sorts them in ascending order. Here is my text file 802 3110 801 7025 890 3120 870 3303 84...
[1 reply] : So I figured it out. I removed my do while loop and it worked, but I d... (by the lone programmer)
char input help
 
Removed.
[1 reply] : return name ; This is attempting to return the 31st element of the a... (by Repeater)
float numbers
 
Create a program that asks the user for two float numbers. Then asks the user if they would like to: 1. multiply the numbers 2. divide the numbers Creat...
[1 reply] : duplicate post: http://www.cplusplus.com/forum/general/223019/ (by Chervil)
help me :(
 
Create a program that asks the user for two float numbers. Then asks the user if they would like to: 1. multiply the numbers 2. divide the numbers Creat...
[1 reply] : Basic input and output: http://www.cplusplus.com/doc/tutorial/basic_io... (by Repeater)
by Ganado
Image editor - efficient pixel data
 
I'm making a simple image editor for fun. It has a feature that's analogous to having multiple frames/layers in Photoshop, memory-wise. I'm not expecting any Ph...
[10 replies] Last: You're describing software-based rendering. This is still possible (in... (by helios)
Do While Loop
 
I need help making this program work #include <iostream> using namespace std; int main() { int x=0, evenSum=0, oddSum=0, num; do ...
[1 reply] : Original code with code tags to aid legibility : [co de] your code... (by Chervil)
can someone help me im running into some problems
 
deleted
[4 replies] Last: All of those errors are linker errors which usually means that the fun... (by jlb)
The advantages of iterators
 
Hello all, I finished chapter 20 of the book " Programming Principle and Practice using C++ ". There is a postscript at the end of this chapter: " If we have ...
[5 replies] Last: Theory is fine but when there is an example (on the explained subject)... (by Frank14)
Can I use cout statement in a void func in a Header class?
 
Below is the Header, I have trouble with. Anyways I cant use cout here, please give me some pointer on what to do. //Animation.h #pragma once class Anima...
[2 replies] Last: Thanks. I tried it and it worked. Thanks alot. (by mpansilu)
C++ and Linux
 
Hello guys, I'm an intermediate-level programmer of C++ and have recently started studying Qt, QML and OpenGL. Since they are mostly using C++, the task is not...
[8 replies] Last: Thank you all very much. I appreciate your help. (by Frank14)
by AB21
Help with ERROR statement please?
 
This is my assignment. Write a program that computes the quarterly average sales for a salesperson in a department store. Every three months, the store calcula...
[1 reply] : If you've removed the statement you're having problems with, how are w... (by AbstractionAnon)
Calculate highest grades
 
I am creating a program that when you input a .txt and input an output file .txt also into the program the program reads which student has the highest and lowes...
[2 replies] Last: Thomas1965 how would i do that, and yes (by Brandon i)
Loop won't break right
 
Hi folks! Got stuck on an assignment. It's 99% done and does what I need it to do except for one thing: I can't get the loop to break properly. #include <ios...
[2 replies] Last: Had to tweak it a little bit to fit my code, but it made SO much more ... (by Corbenik)
File handling problems for struct.
 
Hi guys. can someone help me? my problem is that i want to put the data i streamed to a file back to the struct but i dont know how to do that. heres my program...
[3 replies] Last: > what is stm stm is the name of the variable (of type 'reference t... (by JLBorges)
October 2017 Pages: 1... 89101112... 16
  Archived months: [sep2017] [nov2017]

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