Beginners - January 2014 (Page 22)

C++ sort string in comparator function
 
Hello there i am currently using a comparator function in STL map for sorting date of string data type in ascending value. My dates are in this format for e.g. ...
[3 replies] Last: If lhs/rhs.substr(2,3) is the name of the month, then you can just che... (by Zhuge)
Basic (Modulo) Arithmetic
 
The following a the reason why one should never stay up late at night and do programming contests. I am stuck on this basic question that was is yesterday's COC...
[1 reply] : I'm not sure how far you've already gotten with this. I thought I'd gi... (by wildblue)
Helppp please
 
#include<iostream> using namespace std; void main() { int i; for(i=4;i<=24;i++) { if() { cout<<i<<endl; } } system("pause"); } how ...
[8 replies] Last: You can get your desired output by this code. #include <iostream> ... (by Shravan40)
cin >> if
 
So i'm making a simple program to keep score for a game of cricket. I'm getting stuck when it comes to inputting the players score for their turn. If the player...
[5 replies] Last: yeah that works but i'm new and didn't know i could do that. Thanks (by Axiom34)
Resistor
 
The program is giving me undeclared identifiers everywhere. It is like the programs are not linking. Resistor.H #include <iostream> #include <iomanip> #...
[9 replies] Last: Could not wait on you slow people. (by TenToesUp)
Explanations
 
Can anyone tell me what does exactly every line of the next program? Thank you. // T3_P1.cpp : Defines the entry point for the console application. #inclu...
[12 replies] Last: Line 7 creates a file stream, although it does this outside of main wh... (by CplusplusAcolyte)
noob help
 
So I just started a course and wanted some general help and understanding. when I run a file to test it for errors I trip up an error. ' "c:\Projects\Con....
[9 replies] Last: Just to point out how to apply the above suggestions, you can see my o... (by CplusplusAcolyte)
by enemy
How to read that file?
 
Hello! Please, is that file ok? How to get it written out? Many thanks! // basic file operations #include <iostream> #include <fstream> using namespace st...
[6 replies] Last: If all you want to do is print out the whole file, you could even do ... (by long double main)
Binary Search Tree Help
 
Binary Search Tree's are one of my weak points in C++. I understand the concept but utilizing them is completely foreign to me. Below is the code from my textbo...
[2 replies] Last: it makes complete sense. I don't know if I could have come up with tha... (by toonhead85)
dynamic dimension of arrays before the main function
 
Hello everybody, Please let me know how can I define arrays with dynamic dimensions BEFORE THE MAIN FUNCTION STARTS. I need to use that arrays in classes def...
[16 replies] Last: Thank you very much. project done. (by irajkoohi)
by Babel
I need some help with my code.
 
I keep getting error codes whenever I compile but I'm not understanding it. Would anyone be willing to help? #include <cstdlib> #include <iostream> #inc...
[1 reply] : Put line 7-10 inside the main() function. (by Peter87)
by enemy
pi out of function value
 
Hello! In this example, variable pi is declared out of the function value, but in the same namespace. Is it authomatically entering the function then? Ma...
[2 replies] Last: Thanks, that's it! (by enemy)
by Cipop
Help with code that modifies string
 
Hy guys, I'm havin a problem with this coe bellow. It's supposed to transform text on the wall to text user wants e.g. from "efgh afao gagsw" --> "###h ###...
[5 replies] Last: Great, thank you guys. @rich1: I didn't remembered that, will try it ... (by Cipop)
CYK ALGORTIHM, RUN TIME ERROR
 
Program : CYK Algorithm, I did it using strings and vectors. Code is compiling without any syntax errors and also asking me to Enter string but there is some...
[9 replies] Last: changed the 69 line as vector<string> TT ; and while(getline(... (by rahul yadav)
by Alby94
Set_terminate
 
The program call myterminate and std::terminate.. why? #include <iostream> #include <exception> void myterminate () { std::cerr << "t...
[3 replies] Last: Ah ok, while unexpected returns to the caller .. ok thank you so much ... (by Alby94)
Console output formatting.
 
Hello I've written a little console game and I'm wondering how I get the output to stay at a set position, as you will se from the output, the output is slightl...
[2 replies] Last: Thanks, works like a charm ;) (by Pethead)
why answer comes zero ?
 
hello , this code works fine i want to know why answer comes zero ? . plz dont mind .h in header files , it runs in turbo c++ and borland 4.5 . ‪#‎in...
[3 replies] Last: thanks for the answer . i have to use them cuz of school (by jayssj11)
Copy constructor doesn't get called but it still has an effect on the code
 
class A { public: A() { cout << "A's constructor" << endl; } ~A() { cout << "A's destructor" << endl; } }; class B { public: operator A() con...
[4 replies] Last: cire, I ran the code you linked to in visual studio 2010 and here's th... (by Persson)
not a number exception and zero division exception
 
Hello Im very new to all of this but studying computing at university basically I need help with two things ( I have to use Eclipse Helios) the first being to c...
[1 reply] : You may have more luck on a forum where Java is topical. (by cire)
by cppmos
Basic question about function scope
 
HI~ I am a cpp beginner and have a question about class function scope~ My program (modified) is as below: test.h: class test { public: int A(); }; t...
[3 replies] Last: ¡já!, the code was real. I apology. (by ne555)
January 2014 Pages: 1... 2021222324... 44
  Archived months: [dec2013] [feb2014]

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