General C++ Programming - December 2013 (Page 15)

Using sizeof with array?
 
Hi, I'm trying to calculate the size of values I've dynamically allocated memory to, i.e. col_ind = new long ; row_ptr = new long[inrows+1]; val = new...
[6 replies] Last: Ah, it's part of a (very long) assignment to return the size. I'll jus... (by ocprodigy)
Row and column index
 
If i have current index and row/columns count how do i get on which row and on which column index is individually? This is what i have tried, but column inde...
[4 replies] Last: Thanks. (by morando)
by nvrmnd
get/set, struct, encapsulation ...
 
recently i've read an article that claims that every member w/ get/set method is a quasi-class( badly designed ) My question is if get/set methods are bad,...
[12 replies] Last: I think the object is more qualified to validate the data. By instance... (by ne555)
pointer
 
#include <iostream> #include<conio.h> using namespace std; void main() { double *p,*q,*m,x1,x2; void sumpo(double*, double*, double*); p=&x1; q=&...
[5 replies] Last: read my post again. and read mats post again. (by mutexe)
Can somebody explain malloc's behaviour?
 
Hello here int result = 0 ; int *ptr = (int *)malloc(sizeof(int) * 2); while (*ptr) { *ptr++; result++; } Above , result = 6 int ...
[7 replies] Last: I think i should give up coding too :/ (by mutexe)
Streaming App
 
how should I make a streaming App in c++? I was thinking about taking a snapshot of screen and then streaming it, but I guess that's not how streaming works, ri...
[no replies]
Need urgent help for Programming with PThread
 
Hi guys, i'm trying to parallel this program using Pthread butall seems to going wrong someone can help with how can I parallelize the function named "selection...
[1 reply] : You need to use the code format tags (from the palette on the right) t... (by kbw)
PASSENGER PROGRAM
 
CREATE A PROGRAM FOR PASSENGER FARE. THE SYSTEM MUST ASK THE USER TO ENTER AGE OF PASSENGER. IF AGE IS BELOW 12YEARS OLD, THERE IS A 10% DISCOUNT, ELSE 5% DISCO...
[9 replies] Last: thanks.. mutexe.. :) (by halimdeki)
How do I share information in multifile project
 
this last few days I've been coding this one particular file Hero.cpp namespace Hero { namespace { // all data here } } then the cod...
[12 replies] Last: are you trying to say I should do it like this ? I wouldn't recommend... (by coder777)
Simple question.
 
Can anyone explain to me why I can't do this... GameObject* m_enemy; m_enemy = new Enemy();
[4 replies] Last: There's not enough information in the code provided here. Ideally, we'... (by MrHutch)
Binary Search Vectors
 
Hi! So what I'm trying to do is write a program that fits to a separate test program. The test program provides different size vectors that my function should t...
[2 replies] Last: OR if ( data.empty() ) { return -1; } (by abhishekm71)
by marina
help me convert java to c++ please
 
Programming help to find path B to A , B to C and B to D. inputfile : http://image.ohozaa.com/view2/xhfjIjnbQ4HVdSjM outputfile : http://image.ohozaa.com/...
[2 replies] Last: I don't know . I try to write about this, but it also failed. #inc... (by marina)
Having a windows error at the end of program
 
My error: Myprograms.exe has stopped working a problem caused the program to stop working correclty. windows will close the program and notify you if a solut...
[3 replies] Last: http://www.cplusplus.com/forum/general/112111/ // displayOutput() for... (by ne555)
Issue with division.
 
I am trying to create a program that calculates fraction of time remaining when a student leaves during the middle of the semester. I have to use function files...
[4 replies] Last: Thank you. That worked! (by Viraldude)
Stream.read operation in Tandem?
 
If I am using the ifstream.read method in c++ in an outer loop when reading the contents of a file and I then have an inner loop to ascertain a combination of v...
[2 replies] Last: Yes there are faults in my code. I've simply tried to give an ide of ... (by dominover)
Setter function not holding value
 
I have a character with x and y coordinates. When I set the coordinates in DungeonLevel, the values are gone by the time I try to get them in the main function....
[2 replies] Last: Oh thank you! I figured it was something along the lines of that!! (by hippomandapanda)
by rubait
Want to Design a programe
 
hello all! I want my c++ code run like a software! (As a calculator etc in windows) Which new things i have to learn?? any help would be appreciated ...
[2 replies] Last: QT Creator makes GUI applications incredibly easy to make. You might ... (by htirwin)
Comparing parts of a string with another string!
 
Hi, im wondering if there is a way to compare two strings that aren't identical with each other. instance: str1="ABC123"; str2="A****3"; if(str1==str2) { co...
[5 replies] Last: It's a match with your problem? (by condor)
by rsmith
unordered_map troubles.
 
I have a class called 'Graph' which has two unordered maps as private members. I add pairs to these maps and it seems to work fine. But when I try to use the ma...
[5 replies] Last: Thank you norm b and Catfish666. I just figured that out as I was work... (by rsmith)
"Big Bang" programming
 
So, I've been out of the C++ game for awhile, and I'm getting back into the groove. Decided to create Pong, by using the same sort of framework that's in place ...
[3 replies] Last: Ah that did! Resolved most of those errors. Thank you sir. (by ResidentBiscuit)
December 2013 Pages: 1... 1314151617... 37
  Archived months: [nov2013] [jan2014]

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