General C++ Programming - November 2011 (Page 20)

executing code in a different file
 
So I understand that a method used by some virii is to run code that is say attached to a picture that has been cached from visiting a website. How does a pr...
[5 replies] Last: cool, thanks, I am not writing a virus, but find it fascinating. I fo... (by closed account zwA4jE8b)
Problem in code
 
How to clear a string?I have a data member const std::string& n.I need to clear n value when i give an invalid input.I tried the below code: n.clear();//not wo...
[1 reply] : If it's const, that means you can't change it. Calling clear() should... (by kbw)
I need help finishing that program please
 
#include <iostream> #include <iomanip> #include <string> using namespace std; void Receive(int *Car, int Num); void Remove(); void Display(); void Current(); ...
[3 replies] Last: I thought I was done but when I tried compiling it, some the options j... (by molus87)
Multi Threads Programming
 
Hi, I've been coding a Game Engine of some sort, and I've decided to do this in C++. I've read about multi threading for better perfomance, read a few tutor...
[no replies]
THE CHALLENGE!!!
 
Hi Lads, I'm trying to develop skills in file input/output. And I came out with a small challenge to. I want to hear your ideas regarding it. So, there is a s...
[4 replies] Last: A 2D array in C++ (or C) must have its second dimension known at ... (by ne555)
Why I can not convert float to int correctly
 
The folloing code looks to me a bug. Can any body help? Thanks float c= 0.01, v=0.001; float u= c/v; cout<< "u="<<u<<endl; int y =(int) u; ...
[4 replies] Last: double is innaccurate too. You may want to round instead of truncate... (by ne555)
by mattia
Difference between seekp() and seek()
 
What are the difference between seekp() and seekg() ? seekg() should be a ifstream method, and seekp() a ofstream methods, so if i use fstream i can use both,...
[3 replies] Last: so i can use seekg for writing without any problem, right? No. seekg(... (by helios)
modifying streambuf of an istream object
 
Hello. I want to strip away "comments" from my istream and rewind it. (this might be a bad idea, let me know) My "comments" start with std::string delimiter a...
[2 replies] Last: I was trying to stay stick to standard library. I will definitly give ... (by samusamu)
Need help combined 2 lists into 1 newlist. Almost there.
 
I am trying to combine list1 and list2 into newlist but am having a few errors. After these 2 lists combine, their values will be zero LinkedList catLis...
[1 reply] : There are some thinks I don't properly understand: 1st: when you combi... (by samusamu)
arrays
 
okay, another array question. I have to modify the input and outit as modified array. here is the code. //File name: array.cpp //Created by: Ricardo R...
[1 reply] : for(int j=0; j<numElements; j++) { list1 =list1 -average; cout << " ... (by samusamu)
Help, urgency!
 
i got a homework that i should use mfc, based on dialog, to finish the binary search tree. who can help me with the code? thx...
[2 replies] Last: you have to write the code first .. we will help you to fix the error ... (by bluecoder)
by isnork
Issue with dynamic casting
 
Hi, I decided to create a function that would do a dynamic cast to a pointer and throw and exception if the cast couldn't be done. Something like this: v...
[4 replies] Last: Ok! Thanks helios! (by isnork)
gpa for male and female students ?
 
a question that inputs a set of letter codes f for female and m for male plus the gpa and then computes and outputs the gpa for both male and female students us...
[1 reply] : What is a question that inputs a set of letter codes f for female an... (by cnoeval)
y dis output??
 
#include<iostream.h> #include<conio.h> int& sample(int b,int& a,int* p) { a-=(-b); cout<<a<<'\t'; cout<<p <<'\t'<<*(++p); return a; } void main() ...
[4 replies] Last: To strengthen Moschops's generaly correct answer, it's not just a "rul... (by Cubbi)
Problem with a 2 dimensional array
 
In the array, it is very simple I need to write code that displays the total salary for each of the 3 teams whose player salaries are stored in the above array...
[3 replies] Last: 01. #include <iostream> 03. #include <iomanip> 03. 04. using namesp... (by scott freeman)
Rounding off numbers
 
Hi all, Here is my piece of code. double availableUnits = calculateAvailableUnits(some arguments); int minimumRequiredUnits = getMinimumRequiredUni...
[1 reply] : The only way without changing calculateAvailableUnits() is to relax th... (by helios)
sparse matrix with classes and linked list
 
I am trying to create a sparse matrix using 2 classes and an ordered linked list to contain the data. But the problem is the head pointer for the linked list a...
[3 replies] Last: I updated my first post and used code tag also updated a more full cod... (by Xiphias)
Hello guys
 
Could anone please check my programme, this program is for checking if a string is a palindrome or not (written in dev c++) PROGRAMME ______________...
[4 replies] Last: thanks (by Paritosh P)
LETS PLAY A GAME... decent into c++ madness.
 
hey folks, im new to C++ and im trying to write a simple little "call to function" program for the game snakes and ladders.. simple.. yet killing me.. on the in...
[8 replies] Last: im getting some crazy error messages... that i dont know what they ar... (by helios)
operator<< overloading
 
How do you overload << so that when you want to print details in a class you can simply do this: int main() { testClass ob(123,123); cout<<ob; } class testCla...
[9 replies] Last: Before i print the class do i have to do this all the time? pd.operat... (by codekiddy)
November 2011 Pages: 1... 1819202122... 47
  Archived months: [oct2011] [dec2011]

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