Beginners - January 2018 (Page 16)

i need help
 
i was create new project in visual studio 2010 i was write this code: #include<iostream> #include<fstream> using namespace std; int main() { ofstre...
[4 replies] Last: it is get me "Press any key to continue" (by programming02)
iostream cin in a loop
 
Hi guys, I'm quite confused as to why this is happening first when I enter a letter instead of a number the else statement gets executed as expected and fail g...
[4 replies] Last: To find complete solution about iostream cin in a loop, Traininginluck... (by shivkumar12)
[Error] invalid types int[int] for array subscript
 
I try to vompile my program but what ever i do i get this error. I know where the problem is i just don't know how to solve it. this is the declaration: ...
[15 replies] Last: Thank you that helped a lot (by niksacokica)
Getting Errno::EMFILE when saving to file continuously
 
Hello. I have a code to compile certain information as a text and save it in a file every specified period of time, line after line. void compileInform...
[2 replies] Last: Thanks. Just wanted to make sure that the code had no issues. The culp... (by igorland)
by Ganado
Unspecified behavior example
 
Just need a sanity check. The following would be unspecified , but not undefined , correct? I am 99% sure it's just unspecified. #include <iostream> i...
[9 replies] Last: Thanks for the replies, everyone. Separating f() and g() calls into di... (by Ganado)
merge
 
I have to use a function to merge two string in a increasing matter the user gives the number of elements of first array and then it's elements and same for sec...
[4 replies] Last: //I'm not allowed to change anything in the function on top Do you m... (by dhayden)
Malloc question
 
I am having some problem using malloc pointer array_input correctly. The problem I am having now is that array_input is already declared as integer pointer...
[9 replies] Last: It won't work the way you try to do it, And I'd recommend to detect th... (by benhart)
Question about my function
 
Hey all, I don't see my fault. I wish that in code below: The result are the numbers from 1 up to the give 'n'. //hs 5_4_som 1 - n #include <ios...
[4 replies] Last: Now, changed it a little bit more.. And my code is running as i want. ... (by murr0010)
How could I initialize variables I want to input data in?
 
Hello everyone. I am a new person and I have the code snippet code that has not yet run, can you help me? #include <iostream> #include <string> #include...
[2 replies] Last: Hello kullboys, PLEASE ALWAYS USE CODE TAGS (the <> formatting button... (by Handy Andy)
stack and queue
 
i am creating a stack and queue integer program, however the stack section is producing some errors such as 'type name is not allowed' on things such as (void)...
[1 reply] : Line 4-9 look like they should be removed. (by Peter87)
cin wrong input
 
hi guys I am trying to figure out a way to check for the correct input for example if I type steve in for id it will not work as id is an int, I thought my c...
[9 replies] Last: int i; cin>>i; if(cin.fail()) { // do error handling here } syntax... (by sm2345110)
How Do I access a map private member from public function member
 
Hi! basically I can I access the private map from the constructor but not from other members :-( class FAnagramGenerator { public: FAnagramGe...
[1 reply] : You map stores pointers to strings. You store pointers to strings tha... (by cire)
Read/Append to same file (listing primes)
 
Amatuer c++ coder here. I was bored and was writing a program to check for prime numbers (yes I know this has been done 1000's of times). The part I want to a...
[9 replies] Last: I'm running bloodshed DEVc++ 4.9.9.2. Relevant: http://www.cplusplu... (by cire)
restocking inventory with inheritance
 
I am trying to write a function that will restock the inventory ( a vector of shared pointer of "Item") when the number of items for a product sold is lower tha...
[7 replies] Last: what do u mean ? where do i use this structure: if (true) { // .. st... (by TheIdeasMan)
by MidoLY
Files
 
Hello guys I need a program to open file and write numbers Then square the numbers in new file I am still beginner so make it very simple Thank you;
[3 replies] Last: Please note that this is not a homework site. We won't do your homewor... (by keskiverto)
Checking for odd numbers and problems with multiple files
 
I have no idea why this code wont work. It doesen't print out anything to the screen and it doesen't ask for any input either. #include "Oddities.hpp" ...
[2 replies] Last: It may not be working for you because you aren't flushing the output. ... (by dhayden)
Store values in array
 
How do I have user input 2 integers and store them in 2 separate arrays?
[3 replies] Last: it isnt exactly the same question, but it begs us asking 'what exactl... (by jonnin)
by H00G0
vector.erase() question
 
Hello! I have a simple question about a vector operation. Let's say we have this: vector<int> numbers; numbers.push_back(0); numbers.push_back(10); numbers...
[6 replies] Last: Thank you Chervil I will keep that in mind for later posts ! (by H00G0)
Bringing in an .txt file
 
Write a program that displays the contents of the file in three columns titled “Name”, “Quantity”, and “Price”. The program should also displa...
[8 replies] Last: Hello liz Lopez, Sorry for the delay, I have been down with a cold or... (by Handy Andy)
x++ * ++x?
 
Hi, may I know why is y= 35 instead of 36??? int x=5,y; y=x++*++x; cout<<y // Output: 35
[2 replies] Last: This is undefined behaviour. If a side effect on a scalar object is u... (by JLBorges)
January 2018 Pages: 1... 1415161718... 22
  Archived months: [dec2017] [feb2018]

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