General C++ Programming - July 2015 (Page 14)

by olette
Can anyone help me get started?
 
This is my assignment - The volume of a cone is given by the formula: V = N r2 h / 3 For the value of N use: const double PI = 3.14159265358979323846...
[4 replies] Last: Read above. That was excellent answer (by eraggo)
Why is a double pointer necessary?
 
So I've been practicing on recursion and writing a binary tree but after some input I was told I needed a double pointer for inserting. Oh and I know my print f...
[5 replies] Last: Oh, I see that now. That's a potential huge memory leak. Thanks for t... (by cppnoob25)
by rosa
C1083: Cannot open include file: 'sys/socket.h': No such file or directory
 
I am trying to build a project using Qt creator tool in windows but when I built it , I got this error: error: C1083: Cannot open include file: 'sys/socket.h':...
[3 replies] Last: http://xerces.apache.org/xerces-c/ (by helios)
classes(recursion in methods)
 
i was writing a code for binary tree class.I am not able to write the code for in order print. my code https://ideone.com/7a0u3a the problem is that the met...
[4 replies] Last: thanks it is working fine. (by sharangchopra)
by olette
Need help
 
#include <iostream> #include <string> using namespace std; void getSize(int&); void getSpace(int, string*); void inputData(int, string*); void printD...
[8 replies] Last: I think you didn't read my last post. getSpace should take a refer... (by cire)
request for member of non class type?
 
When I run my code I get this error and I don't know how to fix it. error: request for member 'push_back' in 'v', which is of non-class type 'Vector<int>()'| ...
[6 replies] Last: Thanks coder that makes more sense. I still don't understand my error... (by coder777)
by frisk
Problem in a function when i pass THE string
 
HELLOOOO i have a stange problem.. hoping you can help me. this is the main int main(int argc, char * argv ){ if (!argc>2) {cout<<"\nPochi argomenti...
[6 replies] Last: Well.. gode point (about argv), my is a stupid move. thanks for advic... (by frisk)
by Ozzy69
Why appear the string yeahh twice?
 
Hi, why appear the string "yeahh" twice in the code: #include <iostream> #include <fstream> using namespace std; int main() { fstream sexo("cuzi...
[1 reply] : Becaue you are looping on eof which is incorrect. You should loop on i... (by MiiNiPaa)
Forward-declarations and inheritance
 
Hi, I have a type called "Watchable", which can be pointed at by a "WatchPtr" (a template which accepts any type extending Watchable). When the Watchable objec...
[4 replies] Last: I suggest /** This is a pointer that let's you observe the lifetime ... (by helios)
Card game - help
 
Hello! I made a simulation of the card game War, but I'm having some trouble with the randomization of the cards in each persons hands. But I'm at a loss at whe...
[2 replies] Last: @Bdanielz http://www.cplusplus.com/reference/algorithm/random_shuffle/ (by naraku9333)
Tax program issue (not sure what to do :L
 
Hello! This is my first time posting as I'm pretty stubborn when it comes to getting help with anything, so I'm gonna give this a shot. I have this assignment t...
[1 reply] : Quick google search https://www.google.com/search?q=relative+taxable... (by Bdanielz)
Memory access problem with pointer
 
I'm having a run-time error with memory access. I tried to shorten my code below to highlight what's important, hopefully I didn't take out what's useful to ana...
[3 replies] Last: You were right that wasn't it. It was because of my destructor and I ... (by BarelyOtaku)
What am I doing wrong here? (Pointers and references)
 
I'm not sure how to correctly do this. This is just for practice and serves no real purpose. That's why I didn't make a class. I'm basically creating a linked ...
[4 replies] Last: Thank you shadow. That helped a lot. (by cppnoob25)
Help with pointers
 
#include <iostream> #include <string> using namespace std; void getSize (int *numStrings); void getSpace (int *numStrings, string newArray ); void inpu...
[2 replies] Last: Sorry for not putting the code within code tags but thank you so much ... (by ankitdua)
Having trouble opening a text file
 
Hello! Good morning! I'm trying to do some math with a text file that looks like: Mary Baggins 30000 20000 0.10 Tom Clark 20000 2000 0.08 Mark Twain 250...
[1 reply] : textfile >> data.A reads Mary . >> data.B tries to read Baggins... (by MiiNiPaa)
Forgot binary file read :(
 
Hi I have a file users.txt in server and client send a user name and server checks it, but I can only check the first name. So I open the file as binary File c...
[3 replies] Last: You need to send the file name to the server. (by helios)
improving my string implementation (1,2)
 
So I wrote the code for the string class but I know it can be improved. Especially for the += operator. Here it is: #include <iostream> #include <cassert> ...
[28 replies] Last: If the order of declaration of non-static member objects of a class is... (by JLBorges)
Program keeps crashing after i give 2 inputs!!!
 
Hi I need help on my program that keeps crashing exactly after two inputs.. ive been stuck on this for really long and idk whats wrong :( /* Write a program ...
[4 replies] Last: Thank you so much for you help!! (by wildcharizard)
Snake Game Problem
 
Hey! So for an assignment I have I have to create a snake game along with adding a couple of my own features. I'm able to run the game perfectly, but I'm having...
[1 reply] : Your problem is that you actually start a thread, but due to the joins... (by coder777)
by TChen
Workaround of insert different type object in one container?
 
#include <iostream> #include <vector> #include <map> #include <string> using namespace std; int main () { map<string, vector<float> > m_data; // insert so...
[7 replies] Last: Store data in float is because these data come from GPU, and for GPU ... (by MiiNiPaa)
July 2015 Pages: 1... 12131415
  Archived months: [jun2015] [aug2015]

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