Beginners - December 2013 (Page 16)

Include Coding Standard
 
Hi all, my question is quite easy, but i cant really find a yes or no answer. when including files where would you generally put your includes? Example One: ...
[4 replies] Last: I go with a.h: #ifndef INCLUDED_A_H #define INCLUDED_A_H class a { //... (by Cubbi)
by ham669
Need help with loops and arrays please
 
Ive been asked to create a poem generator that creates 3 line stanzas. Im using a txt file that has all the words i want to use in it with one word per line. Th...
[2 replies] Last: Thanks Mobotus big help :) How do you put the code into that blue box?... (by ham669)
Help with shifting bits!
 
#include<stdio.h> main() { int Oxygen=5; printf("%d\n%d\n%d",Oxygen,Oxygen<<5,Oxygen>> 5); return 0; } Result is 5 160 0 Couldnt underst...
[3 replies] Last: Thankyu both!! Got it now.. (by ammusctce)
by layanM
help urgeeeenttttt :"(!
 
i really need help i was absent in this class (arrays) and i dont know what to do :( i have an assignment due on sunday :"(!! i asked the doctor if he explain t...
[4 replies] Last: ok nice but there aren't any loops in ur code (by layanM)
ifstream 2
 
long begin , end; ifstream file("READ.txt"); begin=file.tellg(); file.seekg(0,ios::end); end=file.tellg(); file.close(); cout<<"SIZE IS " <<(end-b...
[2 replies] Last: Thank you :) (by Sharan123)
How To Use fstream To Read Multiple Lines
 
At the moment I am using my code to read multiple files, but i would like to be able to use my program to read certain lines in the single file, for example, at...
[1 reply] : You should generalize your code and use a loop. also wouldn't hurt to ... (by yulingo)
by dero
Urgent Subtracting two decimal numbers in a file
 
hey all I am a c++ beginner and I am having a little trouble figuring this problem out.. hope u guys can help me out and guide me through it .... I am tryi...
[no replies]
Const auto reference in range for
 
const auto: I know auto ignores top level const but how do you fix this code #include <iostream> using std::cin; using std::string; using std::cout; using st...
[6 replies] Last: Tell us your compiler and version and the exact error message you get ... (by Duthomhas)
Cant access a .txt file?
 
So i made a code that would make a .txt file called Game.txt, then the user would be able to input data into that file, and press ctrl-z to mark the end of the ...
[no replies]
Restarting login program
 
I have a simple program that allows a user to login, enter their password, and do a few basic methods like record the date and time. I am trying to set the pro...
[2 replies] Last: I think I understand what you mean by it. Maybe my execution is off t... (by danipoak)
STL
 
In this code vector is used but i don't understand why couldnt i write it differently explained in code vector<double>v; v.push_back(1); v.push_back(2...
[13 replies] Last: Because logically it is incorrect. The program compiled and ran, but ... (by kevinkjt2000)
Debug assertion failed! Invalid null pointer.
 
I got a school assignment where I need to encrypt what the user writes in and then decrypt it againt. I can run this code so it starts but when I come to the po...
[1 reply] : A lot is wrong here really, but one big problem (lines 84 and 137) is... (by tipaye)
help me urgent@
 
how do i sign in with a username and password on it.i just have a coding enter password to log in void Password(void) //for password option { system("c...
[1 reply] : Please read this: http://www.cplusplus.com/forum/beginner/1/ (by kevinkjt2000)
Is this true
 
Is using using namespace std; not good. I just read an article in the C++ faq and it said that std:: (cout, string etc.) ...
[9 replies] Last: Is there any software that uses all/almost all those header files Ye... (by Cubbi)
difference bw making pointer and object
 
We have 2 situation in case 1 we made an array of 10 objects of class and in situation 2 we made an array of 10 pointer to a object(assigning its address) what ...
[2 replies] Last: THnak you :) (by Sharan123)
by MHG
Help with random_shuffle function
 
I am new to programming with C++, so would appreciate help with the following: I am using random shuffle to randomly order an array. If I have an array such...
[3 replies] Last: I hope it's not too late if I link to the documentation now: http://ww... (by Catfish666)
Integer to string - How?
 
Write your question here. Hi, I need to present a number as string, but only with recursion. I made it, but the the problem is that it's reversed. What shou...
[4 replies] Last: -char s is wrong here because you can't increase the length of an arr... (by JewelCpp)
addition function
 
Help me for this FOLKS Write a C++ program that computes addition and multiplication of two or more integer numbers as given by the user. Make use functions ...
[1 reply] : This looks like a homework problem... So you might like to read these:... (by kevinkjt2000)
ifstream
 
i made example.txt file in ofstream the problem is when i enter a single letter it exits using getline but works with cin>> #include <iostream> #include<co...
[1 reply] : On line 19 you are using "read.txt". Is "read.txt" in the same folder... (by kevinkjt2000)
string
 
Can someone explain the output line by line code for example what is append what is string::iterator string str = "Nobody is perfect"; string s = ""; //...
[9 replies] Last: THank you :) (by Sharan123)
December 2013 Pages: 1... 1415161718... 69
  Archived months: [nov2013] [jan2014]

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