Beginners - November 2014 (Page 21)

by cGuru
cin.get() AND cin.getline() ignored by compiler..??
 
I am trying to let the user input a username for their blackjack account and not accept spaces in it. Why is the cin.get() and cin.getline() lines being ignored...
[1 reply] : Can you post what you have so far? (by megatron 0)
by nomnum
for loop OR string::at issue
 
Hey! So I am trying to make a for loop that uses 'i' (the counter/increment) as the parameter (argument?) for a string.at() function. for (int i ...
[3 replies] Last: no worries. just remember if you've defined an array with ten elements... (by mutexe)
by Reiz
Can't manage to use char pointers
 
Hi, I am new to C++. I'm trying to create a string class for homework. Interface was given to me. I only need to code implemetation. But I couldn't figure out ...
[6 replies] Last: Pointer is a variable that holds one value. A number. The number means... (by keskiverto)
Multiple Integration Methods
 
So, for an assignment in C++, I need to write a program which calculates the area under the curve of a certain input for a, b, and n values. I have the math for...
[2 replies] Last: Did you figure this out? (by swp147)
by harrie
new array and old array
 
i have problem with the howfaraway function i want newarray = old array -avg but it doesnt print and im not getting the error. void howfaraway (double i ,...
[2 replies] Last: There is more to note: void howfaraway() { // ... declare and set new... (by keskiverto)
Queue
 
Please help me w/ my programme i'm using turbo-c compiler here's a part of my program: my error is when i insert, it says call of nonfunction i hope an...
[2 replies] Last: sorry ,, its somebody said to me that insert(,); is a function : its ... (by bookwormjadi1)
by Favaro
Using if statement inside for loops
 
So i'm confused about this part if ( i % 12 == 0) { cout << "i = " << i << endl; } i % 12 means get the remainder of i which is zero divided by 12 is...
[1 reply] : i % 12 means get the remainder of i which is zero divided by 12 is eq... (by Peter87)
Not adding right
 
Sorry that this is my second post tonight. But I finally got this program working but its not adding correctly. Instead of 2 + 2 = 4 it equals 8. The progra...
[4 replies] Last: OH! That makes so much sense! Both problems you helped me resolve were... (by tlephin)
by ba123
Need some assistance on this.
 
Hello, I want to write a function named printAscending, that will take an int array and the length as its input and output each integer on a line that is greate...
[2 replies] Last: he's right. and inside the array you should do like this if ( my_arra... (by xenovia12)
pointer arithmetic to add contents of two arrays
 
I'm trying to write a function that uses pointer arithmetic to ad the contents of two int arrays, putting the sums in a third array. Everything seems to fuction...
[1 reply] : Probably because you never initialize the index variable on line 55. :... (by TheKingOfTyrants)
Find numbers above and below the average.
 
I am working on a lab problem and I feel like I pretty close. I am supposed to take in 10 numbers from the user. After that I will output several things. The pa...
[4 replies] Last: Yes that does seem painfully obvious now that you pointed it out. Than... (by Endymion)
building a program for cafe menu. help!
 
let say I want one regular coffee and one croissant. it only shows "you have ordered: 1croissant (0.75)" I want it to show: "you have ordered: 1 regular coffee ...
[5 replies] Last: I'm pretty much saying you need a counter variable. If the counter for... (by TheKingOfTyrants)
divisible by 11, could use some help.
 
Hello all! First time posting here, my friend just recently recommended it. First semester c++ course and we are on do/while and for loops. here is the ques...
[10 replies] Last: Actually, you are correct there. I was thinking the first digit had to... (by TheKingOfTyrants)
by cyter
serializing a vector attribute of an object in c++
 
I have an object which has a vector attribute How do I properly serialize it to the sqlite3 database?
[no replies]
Always comes back as magic
 
I'm not quite sure what went wrong, but after i modified this so the user input is stored into an array everything comes back as a magic square. Before i was ju...
[2 replies] Last: Ah! Thank you. I totally forgot about that. (by tlephin)
by larryl
std::min() compiler error with WIN32
 
Hi All: I'm no beginner, but I must be making a beginner's mistake. Building the app on Win 8.1 Pro, Visual Studio 2010. The following WIN32 code:...
[2 replies] Last: Thanks Yanson: That works. I did a search for "NOMINMAX" in ... (by larryl)
Short program
 
The instruction as follows: Given cat.h #include<cstddef> void cat(int* a, int* b, int* c, void (*dog)(int*, int*, int*)=NULL); Write a program tha...
[1 reply] : From what you have given me: First: cat does not have a body so you w... (by Precious roy)
Removing specific characters in string
 
so i have this problem. a word is written then all characters of the alphabet that are not in the word,are written after it,in alphabetical order. so let...
[7 replies] Last: So: 1) add alphabet string to keyword string 2) For each character in ... (by MiiNiPaa)
Outputting a vector into a text file
 
I tried using the ostream_iterator method to output my vector but it hasn't worked. Are there any other methods I can use?
[1 reply] : case 1: #include <algorithm> #include <iostream> #include <iterator> ... (by shadowCODE)
by drax
undefined vectors
 
I have a question which I hope I can make clear to understand. Is it possible to make a loop where user will make vectors and their elements, until he finishes ...
[1 reply] : A vector of vectors could be used to do what you want. (by kbw)
November 2014 Pages: 1... 1920212223... 65
  Archived months: [oct2014] [dec2014]

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