Beginners - February 2015 (Page 37)

by Wagari
Using different forms of the cin function.
 
Can we not use "cin>>" immediately after "cin.get(str,max,char)"? I cant seem to accept a string from a user first, and then after that accept a char value. whe...
[3 replies] Last: http://www.cplusplus.com/reference/istream/istream/get/ The delimiting... (by ne555)
vector::operator[]
 
I was not understanding vector::operator functionality. I was assuming I can do an assignment as shown in code below. But the size of array was not updated aft...
[1 reply] : does not add elements, it merely accesses elements that already exis... (by Disch)
by shaLL
Redirected to atomicity.h when trying to compile
 
When I try to run and compile the code below, I get redirected instead to the file "atomicity.h" on line 45, which says "static inline _Atomic_word " My ques...
[5 replies] Last: Atomicity was never in the code to begin with. This is the code: I ha... (by shaLL)
Finding the occurrences of each letter in a string
 
Hello. This is my problem: "Write a program that will read in a line of text and output the number of words in the line and the number of occurrences of each le...
[1 reply] : Counting would be a better title for your post. I posted something sim... (by kevinkjt2000)
by nasser
Inverse string
 
my problem is to inverse a word in statmente then print the statmente with the new word the statmente is "I love am era" the goal is to be "I evol am era"
[no replies]
isdigit and char string
 
Hello everybody. Can someone please help me figure out what I'm doing wrong? Here is my code: char target = {'\0'}; printf("\nEnter a word to search for....
[3 replies] Last: Never mind. static_cast did it. Thanks goes to John Harrison at http:/... (by Stremik)
Initializing array...whats wrong with it.
 
Trying to initialize array but i get an error no matter what i do. what am i doing wrong? void bD (int n, int r, int b ) { b = {1,0,0,1}; //this yiel...
[5 replies] Last: I was trying to make a binary to decimal converter. I only need it to ... (by jackelinblack)
instead of multiple bools?
 
So i cant figure out how to make this efficient. I could easily just put multiple if's but that seems unethical. So Lets say you have a player, That can pick...
[7 replies] Last: [quote=JLBorges]Aesthetically, NOTHING == 0 is pleasing. More import... (by booradley60)
warning C4805 and error C2181
 
In the code below, I can't figure out how to fix the " '==' : unsafe mix of type 'int' and type 'bool' in operation" and "illegal else without matching if" erro...
[11 replies] Last: [quote=AbstractionAnon]You have not corrected any of the errors I've p... (by AbstractionAnon)
How to Limit Words in DictationGrammar() Object
 
http://stackoverflow.com/questions/28431382/how-do-you-limit-the-words-in-a-dictationgrammar-object WARNING: IN C#
[no replies]
Totally impossible
 
Last week i decided to write an application, quite large to use most of c++ facilities that av learnt so far just for fun, however i faced a bunch of problems t...
[16 replies] Last: @MiiniPaa thank you, surely that makes sense , am correcting that now ... (by closed account SECMoG1T)
vector erase iterator outside of range
 
customer->GetInventory().erase(customer->GetInventory().begin()+choice); "customer" is a class. "Inventory" is a class. "GetInventory()" returns ...
[2 replies] Last: Ohh ok. Thank you :D (by Dolichan)
Linked List Errors: :basic_string<char, std::char_traits<char>, std::allocator<char> >]
 
I am currently trying to get my Linked List, which reads a text file, use my addline and deleteline functions. The issue is that both functions show similar err...
[4 replies] Last: From the error message, it appears you are calling addList and trying ... (by tipaye)
5 values in one line
 
how do i write 5 values per line in a c+= program where i have to print the numbers from 1 to 100? so far i have done the following.i am a super beginner .ca...
[5 replies] Last: The std::endl is more than just endline: http://www.cplusplus.com/refe... (by keskiverto)
GCD
 
What is wrong with this GCD program? int gcd(int a, int b){ if(b==0) return a; return gcd(b,b%a); } If I change return gcd(b,b%a) to ret...
[5 replies] Last: gcd(0,a) = a (wikipedia) int gcd(int a, int b){ if(a==0) return b;... (by anup30)
Shuffle deck
 
How do I use the rand function to shuffle integers from 1-52? I have an array which stores values 1-52, but then outputting it in random order? is there an o...
[1 reply] : #include <iostream> #include <random> #include <algorithm> #include <... (by JLBorges)
Explanation plz!
 
Can somebody explain clearly "line by line" what the code means? Any good links given to read is also appreciated. register char c = getchar_unlocked()...
[3 replies] Last: Thanks Disch! It was clear and detailed (: (by Knightrider29)
Vector output from a selection
 
So I'm trying to write a simple program that will prompt a user to input a number between 0-19 and then output the translation of that number in Spanish. So ...
[2 replies] Last: Thank you so much OxBADC0DE, you gave me a little laugh also. I ended... (by joecookjc)
vector input
 
quick question- using namespace standard, how would you input a vector? would it be like "getline(cin,vectorname)?
[1 reply] : Quick answer - You should probably take some time off to read about it... (by OxBADC0DE)
by Gohmer
Help with Remainder Program
 
I'm having trouble with this remainder program. I can get it to work when num1>num2 but when num2>num1 it says quotient = 0. How can I fix this?
[1 reply] : Nevermind I fixed it, I didn't notice I had the quo=num1/num2 in my re... (by Gohmer)
February 2015 Pages: 1... 3536373839... 52
  Archived months: [jan2015] [mar2015]

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