Beginners - August 2014 (Page 20)

by mehak
returning references
if i omit the static keyword,the output changes,but y? #include<iostream> using namespace std; int &fun() { static int x = 10; return x; ...
Aug 18, 2014 at 2:41am
[1 reply] : Read this: http://www.learncpp.com/cpp-tutorial/43-file-scope-and-the-... (by Smac89)
Random Access File
Hi, I'm having trouble pulling information from the stream when trying to copy a string with spaces in it. For example, trying to copy "Jigsaw Puzzle" to my va...
Aug 18, 2014 at 2:27am
[2 replies] Last: Thanks! It works after i also used cin.ignore(25,'\n') because I'm s... (by gamerguy314)
Linking seperate functions to the main program
I want to link a function which is separated from the main .cpp file. Like I want to call the function from the main.cpp file. How can I do that? I see in l...
Aug 18, 2014 at 12:25am
[10 replies] Last: Yeah! :D Now I have got it :) Thanks vxk and keskiverto for your time ... (by Al Biruni)
why do we need a virtuaal destructor
given the coDe class A{ public A(); ~A(); } class B: public A public: B(); virtual ~B() why do we need a virutal destructor? , i think tha...
Aug 17, 2014 at 8:14pm
[3 replies] Last: if it is virtual a dtor will not be called? If you are calling a n... (by Disch)
Unable to write a condition using code
I am solving a problem where I've to give an if-else condition. I will ask user to input a number. And the condition is the number size will not be more tha...
Aug 17, 2014 at 7:55pm
[2 replies] Last: Please read the tutorial on this site, this question could save everyo... (by Krisando)
using exceptions to check if entry was valid
So im writing a program that converts a seven digit phone number to all the possible words that correspond. In error checking, it rejects (and has the user typ...
Aug 17, 2014 at 7:15pm
[8 replies] Last: Very good advice. Thanks! (by pilotnate)
how to merge and order arrays
Hi!I'm a beginner and I'm trying to make a program that merges and sorts arrays and this is what I got so far #include <iostream> using namespace std; ...
Aug 17, 2014 at 5:53pm
[9 replies] Last: But that does not concatenate. @Dexter You try to sort arra. You hav... (by keskiverto)
by vxk
const confusion
I have 2 questions regarding the following code 1-> why can't i call the increment function inside the inspect function by writing : counter::increment()...
Aug 17, 2014 at 5:34pm
[8 replies] Last: volatile is very seldom used. AFAIK the only time it's useful is for ... (by Disch)
by vxk
difference b/w data structures
Is there any difference b/w a table and a map or are they completely same ? Thanks
Aug 17, 2014 at 4:26pm
[5 replies] Last: The C++ standard has std::map and std::unordered_map. Whether they ar... (by keskiverto)
How to check whether element of vector is same?
How to check if a container of a vector have same element? for example: a vector is contained with employee and task. i want to sort all the task by the name o...
Aug 17, 2014 at 3:34pm
[2 replies] Last: thanks man. (by comebackkid)
How this program executed? Pls Explain..
Write your question here. #include<iostream.h> #include<conio.h> #include<string.h> class strings { char s ; public: strings() { s ='\0'; } strings(char *c) { ...
Aug 17, 2014 at 1:55pm
[3 replies] Last: Line 7 - decide how large you want the array to be and declare it acco... (by Chervil)
Result: runtime error (SIGSEGV)
I've written the following code to count average. In my PC program works fine. But when I submit it into OJ, it shows Result: runtime error (SIGSEGV) What ...
Aug 17, 2014 at 10:27am
[2 replies] Last: Thanks a lot Peter87 (5640). :D (by abdalimran)
Check if specific key is pressed
Hello I want to know how to check if specific keys are pressed. But also on different systems. How to do this for Windows systems? How to do this for al...
Aug 17, 2014 at 7:42am
[4 replies] Last: Thanks for mentioning that one as well. (by Nielyboyken)
Output problem
I've just written the following code. Everything the program gives output is as expected..but a '1' is automatically printed. Thats unexpected. Here you'll f...
Aug 17, 2014 at 6:59am
[2 replies] Last: Thanks a lot! It is supper clear now. You are awesome Disch! :) (by abdalimran)
IF ELSE IF
#include <stdio.h> main(){ system("color E8"); float grade; printf("\n\n\nInput your Grade:"); scanf("%f",&grade)...
Aug 17, 2014 at 5:56am
[11 replies] Last: @Christian0555 Glad we could help. @TheIdeasMan The example isn't con... (by BHX)
by Ch1156
Help with Networking
Ok so I'm using SFML and C++ to do some networking, and I was following a video tutorial on youtube and the program is a chat function, it chats, but what happe...
Aug 17, 2014 at 4:26am
[1 reply] : IIANM, for full duplex communication you need two connections. 1. A li... (by helios)
I would like a better understanding
Hello, programmers and programmers a like, I'm kinda of fairly new to this website and c++ it's self, I've done a little programing in Python , and a gaming sty...
Aug 17, 2014 at 4:13am
[3 replies] Last: for saving information in C++ you gotta learn file handling.It is read... (by cyberdude)
printf problem
This is just a small program I wrote to find a problem with a larger one. Everything changes when I add the line with scanf. I know it is not safe, I read other...
Aug 17, 2014 at 3:27am
[9 replies] Last: IdeasMan, I did and nothing bad happened. My problem was with initiali... (by galactus)
by T4l0n
random order in array
I wanted to have a program that inputs the number of elements in the array, inputs the int variable of the element and outputs the numbers in random order, with...
Aug 16, 2014 at 9:57pm
[3 replies] Last: alright thanks a lot, i made a third loop only to randomize "i" and it... (by T4l0n)
Getting content of text file and putting it in an array
Hello I've got a question but don't really know how to explain it. But I'll try it. I have a text file including names, now my code should take those name...
Aug 16, 2014 at 8:53pm
[2 replies] Last: ^Thanks a lot for your reply! Extremely useful! :D (by Nielyboyken)
August 2014 Pages: 1... 1819202122... 40
  Archived months: [jul2014] [sep2014]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.