General C++ Programming - September 2011 (Page 26)

Help get last two chars
 
So how to get last two characters of a string, Let a user type his desired text that will be stored in a string and how to get last two characters of string and...
[1 reply] : Nvm (by gauthamnekk)
Deep copy problem
 
Im trying to make a game. Theres a player and he shoots bullets, and i was told whats wrong is it is making a shallow copy instead of a deep copy even though i ...
[6 replies] Last: Disch is correct. Also note that operator= continues to use the incor... (by webJose)
Selecting particular values from text document into variables
 
Hi all, Well, sad to say that I am somehow a noob in C++ programming. What I am doing is basically write a .txt document with certain messages followed b...
[2 replies] Last: To read a text file. For example, as shown below is a part of my text... (by kelvinkelvin)
Case sensitive?
 
I'm making a program where there is a lot of commands. To get a command from the user, I use: string x; getline (cin, x); And that works fine and all, but ...
[3 replies] Last: Or you can use: #include <iostream> #include <cctype> #include <stri... (by Nisheeth)
Why is this undeclared?
 
Ok i ran into some problems Dev c++ is giving me errors `Row1' undeclared (first use this function), `Row2' undeclared (first use this function), `Row3' undecla...
[2 replies] Last: they are defined in main.cpp (by Cpp gamer)
by Chathu
F.R.I.E.N.D.S Compiler Error
 
I wrote a program to compare colors of two shapes. If the colors are same it will display a message informing the colors are same else it will display it is not...
[1 reply] : Strings should be surrounded with double quotes. Single quotes are for... (by Zhuge)
Hello
 
Hi im just starting out in C++ i know a fair bit and the reason i got into this is because i love games and i would love to design one for now i just want a s...
[2 replies] Last: Thank you (by BioPawz)
How to calculate or create the process calculating per hour rate
 
the condition given if staff,code S less than 8 hour-RM0.00 more than 8 hour-RM5.00 per entry if not staff,code X less than 8 hour-RM10.00 for first 3...
[no replies]
help
 
ok so we are learning I/O with files. One input file is Data.txt and it contains this: Robby Tono 5 15 Tim Con 2 13.5 Bella Quint 10 5 and once the ou...
[no replies]
Need help with an error in my linked list class
 
Hi guys, I'm trying to make a template linked list class, but I keep getting this error when I try to run the linked list class: Edit: The initial error is fix...
[2 replies] Last: Ah, I see now. I had tried to add a default constructor to ListNode o... (by freddy92)
by NickT
Exercise from B. Stroustrup book
 
I'm doing an exercise from Chapter 7 of Bjarne Stroustrup's "C++ Programming Language - Third Edition". The exercise is: -Write a function for entering new w...
[3 replies] Last: Yep, definitely it's binary tree (by Denis)
Remainder without using modulus.
 
Hi guys, I am trying to find remainder without using modulus. Is there any algorithm to find it.
[3 replies] Last: Another method would be: a%b = a - (a/b)*b (by closed account D80DSL3A)
passing by reference in stack ?
 
I have 2 versions of my recursive function, one in which I pass by value and other where I pass by reference. Suppose I don't modify the argument in the functio...
[2 replies] Last: I think the rule of thumb is: if the object is small (trivial) and you... (by buffbill)
First Recursion Project
 
So our first assignment is recursion and i have almost completed it. I am just having a few issues with the recursive solutions to a c-string reversal and a cha...
[1 reply] : http://www.cplusplus.com/forum/general/49731/ (by helios)
problem when trying to delete array off the heap
 
Here is my code: #include <vector> #include <sstream> #include <fstream> #include <iostream> using namespace std; int main() { //open file ...
[2 replies] Last: Ah... duh... Thanks thus far! Okay similar problem. And this is going ... (by Patrick Burton)
error c2011 when creating multiple classes
 
I've searched the forum for a similar error with no success. Here's the code: this is the main class "test.cpp." #include <iostream>; #include "class1...
[8 replies] Last: Found the problem, just a minor typo. Worked when I copied and pasted ... (by Patrick Burton)
“My_project.exe has stopped working” error message
 
Hello, I have written a program which takes in genome sequences and locates what are called Open Reading Frames (ORFs) in molecular genetics. The following is a...
[1 reply] : You might be allocating too much memory to handle. Are you trying to ... (by Disch)
Where do namespaces come from?
 
Hello, I have never previously used any namespace other than std, however I have been reading about them and I don't understand where they come from. Everyw...
[2 replies] Last: You define namespaces like this: namespace myns { void SomeFunction... (by Disch)
OpenCV
 
Anyone how the the member function ptr works? Its supposed to return a pointer to the first uchar in a matrix's row but I dont really understand its interface ...
[no replies]
Simple Question
 
I have been trying to add 3rd Party libraries to code blocks on a mac for the last 3 hours, but i haven't reached anywhere. I am trying to use wxWidgets, OpenCV...
[2 replies] Last: Yep, if you were using Windows you could use the pre-compiled (or pre-... (by AMCerasoli)
September 2011 Pages: 1... 2425262728... 31
  Archived months: [aug2011] [oct2011]

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