Beginners - March 2013 (Page 36)

Problem with Classes and Objects
 
Hey guys, i was learning classes and objects from a tutorial on youtube. I was learning, how to use variable of a private access specifier. But on the compilati...
[5 replies] Last: class tanmay { public: void setname(int a) ... (by closed account 3qX21hU5)
error: expected constructor, destructor, or type conversion before '<<' token
 
hello, i am debugging my code, im getting the error: expected constructor, destructor, or type conversion before '<<' token, on line 16 any help would be appre...
[6 replies] Last: ah ha! blind mistake, thanks. Ive been experementing with if and if i ... (by declanthomas)
Loop goes infinitly (1,2)
 
Hello I am a total newbie at C++ and I am learning about loops but I have a problem, if I type even a simple loop like this one, #include <iostream> usi...
[32 replies] Last: I will try what you said about cleanup but tnx all for helping! EDIT... (by Astroman)
Doing Math with file inports
 
The file "file1.txt" contains 0.0 0.1 0.2 0.5 0.8 0.9 1.0 I know very little about file I/O and I really need help figuring out how to take each of the number...
[1 reply] : double total = 0; double n; ifstream myfile ("file1.txt"... (by Chervil)
by vrakas
Set and memory
 
does using a set to store integers take more space than using an array to do so?
[1 reply] : Yes. As far as I know std::set is usually implemented as a red-black... (by Catfish3)
by JakOrp
help with file manipulators (read from/output to)
 
Hi, I need to change the following code so that char word is read from a file, and string str3 is output to a file. to start do i use getline (inData,word...
[3 replies] Last: no, not particularly, ill try that. How do i specify what i want to ge... (by JakOrp)
Using a structure in multiple files (1,2)
 
I've just started learning about structures and classes and I don't yet understand how they work... There are 2 things I want to do 1) struct attributes ...
[20 replies] Last: I really didn't notice but, I'm not sure it makes any difference for f... (by S G H)
Text RPG: Help with assigning separate moves to enemies
 
Hey there. I'm a bit of a newbie at C++ (roughly 2 months of experience) and my current college class is progressing slowly so I'm going ahead and doing my own ...
[7 replies] Last: Hm, okay. I'm going to experiment a bit and come back here later. (by EpsilonJackal)
e^x= 1+(X/1!)+(x^2/2!)+(x^3/3!)....
 
hi i do my homework. but i cant write it in class ... please help: #include<iostream> #include<conio.h> using namespace std; int main() { int a=1; ...
[3 replies] Last: wow yesss. thanks so much...now i understand my mistakes. thanks miiin... (by mohsenios)
deque class having problems in inserting dATA INTO THE QUEUE
 
HI ALL i am having problem in inserting data into the queue....will some one help me to fix it ? // deque assng2.cpp : Defines the entry point for the consol...
[no replies]
by krutuk
problems with functions
 
Hi everybody. I wrote down two functions, but after compiling they return rubbish. As I understand they should return 5 and 7. Here is a code. Can somebody help...
[6 replies] Last: I tried to avoid using that short hand because it makes code more comp... (by Warnis)
by reyuqt
A vector containing intervals
 
I have an assignment asking me to create a vector that will hold intervals. I've done everything up until the point where I have to subtract the beginning inter...
[no replies]
Ping commands
 
What is a ping command in C++? I am working on a project and it wants us to use a ping command.
[5 replies] Last: In that context, ping is probably some boolean function that returns t... (by booradley60)
by JakOrp
help with strings/char
 
Hi, I have been asked to edit this code into working order, then edit it. I just cant seem to get it to compile, I'm not asking for a solution, just if you coul...
[3 replies] Last: thanks guys, i obviously wasnt listening when we covered char! makes s... (by JakOrp)
by Exempt
Solved...Converting string to float with sstream issue
 
The fix was to use cout << fixed << gained << endl; I'm using streamstring to convert a string to a float like this... I'm grabbing the number from betwe...
[4 replies] Last: How on earth did you even find out about << fixed I looked on the re... (by Chervil)
shifting bits
 
Hello, I want to make a function that shifts bits to the left and right and append them to the left or the right.I heard that is is called ROR and ROLL? Exampl...
[1 reply] : It looks as though function rolBits() is simply outputting the resul... (by Chervil)
Question about allocate memory!!
 
Hi, I have question on allocating dynamic memory for my sequence project!! The header file is this. #include <cstdlib> // Provides size_t namespace main_...
[4 replies] Last: after test 4 when the destructor deletes the object. So it's very li... (by cire)
by fickle
PLEASE HELP
 
I'm writing a program that reads txt file that has a mad libs story in it like this and it wont compile I was wondering if anyone knows how to help! Zoos are...
[1 reply] : Format your msg with code tags pls (by SamuelAdams)
C++ Console Application only partially working on other computer? (1,2)
 
Hi everyone, I created my first somewhat useful C++ application using Code Blocks. It basically allocates a loss across multiple insurance companies based ...
[22 replies] Last: Guys, Thanks! It finally works. I had to add the sync line sug... (by kevinbright)
by rey9
limiting number of characters to be displayed..
 
can anyone help me with this... i want to output only 25 characters(name and course) in this program..but its display all the inputted characters. here is m...
[3 replies] Last: Why are you mixing C-stdio output functions and C++ streams? You shou... (by jlb)
March 2013 Pages: 1... 3435363738... 87
  Archived months: [feb2013] [apr2013]

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