General C++ Programming - April 2015 (Page 4)

understanding pointers
 
So I've been playing around with linked list adding functions here and there just to test my conceptual understanding of them. This is just a snippet of cod...
[2 replies] Last: Thanks so much for that thorough explanation. Best one I've ever had a... (by cppnoob25)
Vending Machine Simulator
 
The program should create an array of five structures. Each time the program runs, it should read the data from the input file ("DrinkMachineInventory.txt") and...
[no replies]
Problems with Structure Lab. Assistance appreciated
 
#include <iostream> #include <string> #include <cmath> #include <iomanip> using namespace std; const double PI = 3.14159265358979323846; struct Cone...
[2 replies] Last: Thanks so much for the help. Deleting and switching around the syntax ... (by dantelt)
by blubb
how does this work?
 
double E=5.; double F=5.; char filename =""; stringstream stream; stream <<"E="<< E <<"_F="<<F<<".txt"; stream >> filename; FILE*pFile; pFile=fopen(file...
[6 replies] Last: ofstream is a stream stringstream is a stream cout is a stream All st... (by keskiverto)
Quick Question: How to use #if and #define ?
 
How to use #ifndef and #endif to turn on and off debugging code. For my project, I have used several cout statements inorder to check if the program does what ...
[2 replies] Last: @ Disch, Thanks a lot! You explained it very well. Way better than my ... (by newbiee999)
Vector is NOT Adding Elements Properly
 
I have a struct called family which has a father and children (number of children are unknown). Then in add function I add the info of father and save everythin...
[2 replies] Last: @ Peter87 Thanks a lot! I was stuck on this thing since last 2 days. A... (by newbiee999)
Can't work this!!??a
 
Calculating this :z=(3n+m-2)!+(m+n)!!+ 2n!+2xy I need your help :) Thank you #include <iostream> #include <iomanip> using namespace std; struct fac...
[no replies]
Completed code, can't figure out loop for Y/N continue or quit
 
#include <iostream> #include <cstdlib> #include <ctime> #include <cstring> using namespace std; void ShowProgramHeader(); void printInstructions(); void Intro...
[1 reply] : if (option == 'n' || option == 'N'); remove the semicolon, and put ... (by xenovia12)
Triangle area with 3 angles given
 
Given three angles, how to find if it is possible to have a triangle of positive area with these angles.? the input will be like this: 50 60 70 those are 3 ang...
[2 replies] Last: OP, do you mean something like this? http://www.wikihow.com/Determine-... (by mutexe)
Input from a file not working...
 
Well guys Im learning data file handling now and after following the tutorials here,I think the input part of my program is not working. #include<iostre...
[no replies]
by yj1214
(-O3) What is optimization and what is g++'s default level?
 
-o3 I haven't used this flag and don't even know what it does, can someone explain what optimization is and what's the default optimization level in g++?...
[2 replies] Last: Which version of GCC? https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Op... (by keskiverto)
assembly language
 
I want to learn a assembly language. can any one help me to choose assembly language which is best one.
[10 replies] Last: The first question to answer is which CPU do you want to target. Proba... (by dhayden)
by yj1214
Confused with new keyword again...
 
int x = new int; Why is this invalid? What does new actually do? #include <iostream> using namespace std; struct Hello{ Hello(int num)...
[3 replies] Last: It is important to note that dynamically allocated memory isn't partic... (by Food 4 Thought)
by Kyi
Rock, Paper, Scissor using seeds
 
I am now having a difficulty trying to understand this code. // Bjarne Stroustrup 4/4/2009 // Chapter 4 Exercise 10 /* Write a program that plays the game ...
[4 replies] Last: I got this! Thanks :) (by Kyi)
by Kyi
Prime algorithm
 
bool isPrime(unsigned long n) { if (n <= 3) { return n > 1; } if (n % 2 == 0 || n % 3 == 0) { return false; } for (unsi...
[2 replies] Last: I got this! Thanks a million #ITR :) :) (by Kyi)
Numdays class need troubleshoot help!!
 
I cannot seem to get this to run, I'm self learning, so this isn't as homework assignment. My errors are on the << and -=hours worked. Any advice or pointers in...
[1 reply] : What error did your compiler give you? Or does it compile correctly, t... (by ITR)
[please read] voice and amplitude
 
Hi, I'm using windows 7 and VS 2013 express. I am not a newbie to c++ btw. I Would like to make an application that allows you to input voice, extract the ampli...
[1 reply] : You say you are looking to not use a library, but you are asking what ... (by Smac89)
Stack not working as intended
 
I have an assignment where I have to create a calculator which accepts a string containing a POSTFIX equation. My program compiles and executes, but it keeps...
[1 reply] : Have you stepped through with a debugger? This would tell you exactly ... (by ResidentBiscuit)
Allocator rebind from within template container class
 
I've been working on a vector-like container class without pointer and iterator invalidation, and without some of the performance problems of vectors, called a ...
[14 replies] Last: Just wanted to say thanks for your help - allocators fully supported n... (by metamorphosis)
DELETE ENTIRE STRUCTS IN VECTOR
 
So I have a struct called CompanyInfo. struct companyInfo{ string companyName; // Name of the Company string products; // Company's produc...
[3 replies] Last: Just don't erase the company if you don't want to erase the company. I... (by ModShop)
April 2015 Pages: 123456... 28
  Archived months: [mar2015] [may2015]

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