Beginners - December 2011 (Page 42)

Calling upon int main()
 
I am trying to make a text-based RPG game and part of it looks something like this: if (hp<0){ cout << "You died...."; Is it possible to call upon the...
[8 replies] Last: Of course. But you really should consider the loop, particularly the o... (by Duthomhas)
NULL integer ?
 
Hi, the question is probably stupid, but i would like to ask is there any case an integer to be null ? If yes, how do we examine that? I mean we have ...
[2 replies] Last: There is no "NULL" for integers. The NULL is a special value because ... (by Duthomhas)
npos : Unsigned but negative ?
 
npos is a value of type size_t which is of type unsigned int. but since npost is unsigned how can it bears the value of -1 ? Plz help...thank you !
[19 replies] Last: test_little_endian() isn't the important part... but on Little End... (by Catfish)
Problem With Void
 
#include <iostream> using namespace std; void g(); int main() { void g(); system ("PAUSE"); return 0; } void g(){ cout <<"hi there"; } I'm just ...
[6 replies] Last: Thanks firedraco!!! Thank You!! (by trexmix)
by matts1
File reading and writing problem
 
I'm doing a very basic program in C++, after 2 years of python experience. I do not, however, understand why my code does not work. I have tested it out for age...
[3 replies] Last: No, you don't; his code has the constructor open the file. You shouldn... (by LB)
Operator overloading question
 
I had a question about the output of this code.. Shouldn't the output be both $1050. Instead of 1st output $1300 and 2nd output $650.. Or my logic is wrong i...
[3 replies] Last: you didn't initialize your total with 0, so your total contains garb... (by davidcpp)
array from table in .csv
 
I want to populate an array from a table of numbers in a .csv file. I've figured out how to open the file, but I can't quite figure out how to get C++ to read ...
[1 reply] : Use a vector and you're fine: #include <fstream> #include <vector> ... (by IceThatJaw)
friend function, can't figure error
 
Hello, I'm following my lecture notes example and have an error popping out stating: /tmp/cckhUI3q.o: In function `main': friendtry2.cpp:(.text+0x9c): undefi...
[1 reply] : I don't know I'm doing the right thing to demonstrate friend function ... (by Tampopo)
I need help in this code..here I have to find area of a triangle using another class point... what's wrong with this code?
 
#include<iostream> #include<cmath> using namespace std; class Point{ public: double x,y; Point(){ x=0,y=0; //cout<...
[2 replies] Last: got it..:) thanx a lot for your help... (by dreamys)
Don't understand error msg!
 
I really don't understand what this is telling me. Its the only error I get when I debug, but the error is holding me up. 1>Lab 7b.cpp(63): error C2082: rede...
[3 replies] Last: Please consider using for your code next time though (by eypros)
error C2678: binary '=' : no operator found which takes a left-hand operand of type 'const String2'
 
Hey All, Im trying to rewrite parts of the string class for lessons in using new and delete with classes. I am however running into a problem with my overloade...
[1 reply] : The reason you are getting an error is because st is constant to fix t... (by TheMassiveChipmunk)
What is this kind of definition ?
 
char *search_and_replace_alloc(const char *str, const char *oldsubstr, const char *newsubstr) throw(bad_alloc) {} What wit...
[3 replies] Last: If you want. That line just says that's the only exception it is *mean... (by LB)
Any ideas on way this doesn't run?
 
I can't figure out what the errors are telling me. 1>Lab 7a.cpp(20): warning C4305: 'initializing' : truncation from 'double' to 'const float' 1>Lab 7a.cpp(...
[4 replies] Last: I think I go it now. Thanks for your help. #include <iostream> using ... (by sherringtonjr)
Assignment Help
 
I'm new to the site today and need a little help with some homework. I am by no means looking for anyone to give me the answers, just to point me in the right d...
[7 replies] Last: Thanks for the info. I'll make a not for next time. (by sherringtonjr)
Time Class
 
Trying to get this code to work. What the current issue I have is how do I get the now object to get the current time. I also want to know how to use the bool v...
[8 replies] Last: time_t is a integral type which represents seconds since midnight Ja... (by rocketboy9000)
by hbjgd
Reverse Linked List
 
Haha this is my second post about this program. But this time the linked list id being printed in reverse. Anybody see the problem, because I can't. #includ...
[6 replies] Last: @Ihtsiham Looping all the way to the last node every time we add a ne... (by unoriginal)
by traxes
Working with strucures
 
guys first sorry for sparing your time with me.I need to learn from you how to use structure cause i allways try and nothing.Errors and errors.I will post my tr...
[4 replies] Last: add "using namespace std" since you didn't specify the namespace of "c... (by AoZplusplus)
Can someone explain this line to me?/Input help
 
cin.ignore( numeric_limits <streamsize> ::max(), '\n' ); I've had some issues with input in the past, and I was given this line, which helped to get rid of s...
[18 replies] Last: Oh duh! why didnt I think of that :P Thanks for your help :D (by jp01cf01)
by hbjgd
Infinite Loop - Link Lists
 
My print_to_Screen method is causing an infinite loop and I don't like why. Anyone help me? I'm baffled. #include <cmath> #include <iostream> #include <iomani...
[2 replies] Last: Haha. I feel dumb. THANKS!! (by hbjgd)
Help understanding the function of this program?
 
#include <stdio.h> #define number 12266 #define number2 4074 #define number3 16 #define number4 10 char trans ={'0','1','2','3...
[2 replies] Last: ahhh I see. Thank you very much (by mental2)
December 2011 Pages: 1... 4041424344... 47
  Archived months: [nov2011] [jan2012]

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