Beginners - April 2018 (Page 5)

Please
 
Hello everyone, This is part of my code. I cannot get this to stop asking for money. Even when the customers pays over or in full, it never reads "Thanks for y...
[7 replies] Last: thank you all for your input. I was able to finally get this done =) (by Anahuac18)
help with adt problem
 
Hi, So I'm trying to write a code that reads in from a file a book title, number of authors, authors names (up to 4), publisher, isbn, price, and the number o...
[2 replies] Last: You should check that the file opened before reading from it. (by tpb)
cin.getline
 
Am I using cin.getline correctly? building a program using arrays to store data for user inputted employees #include <iostream> #include <istream> usi...
[3 replies] Last: You have a getline just after extracting an int , so you will read ... (by boring)
changing variable with key input
 
Hi guys, I am trying to write a code so when I press a key it changes the value of a variable from 0 to 1. When I press it again, it goes back to 0, and so o...
[1 reply] : When you press enter, you type a character (newline), so maybe try usi... (by boring)
by HUMMAN
Detecting Enter key
 
Hello, i searched in internet about how to detect enter key, yet my trials of getline(), cin.ignore() gave run-time error. std::cout << "Define a value for ...
[2 replies] Last: unrelated but there are nonstandard ways to trap the enter key, if you... (by jonnin)
Getting an array of max values
 
So I have an array of integers. I want to take the biggest integers from that array and put it into a smaller array that just has the biggest integers in it. Th...
[5 replies] Last: ... this is something I would not have even looked for or expected to ... (by jonnin)
fstream help
 
Hello everyone, I am having a hard time figuring out how to form a circular doubly linked list from a text file. With this code I manage to read the start node ...
[5 replies] Last: You're not using classes correctly. You shouldn't have any global va... (by tpb)
Question about snippet from binary search tree
 
I am wondering why the constructor for the binary search tree would want to give left node and right node a nullptr? Does this happen everytime I call a new nod...
[3 replies] Last: Nodes are just clueless actors in a giant play. They know nothing. T... (by icy1)
Error when returning structure in function?
 
I am accepting a structure array as an argument, and trying to return that structure array. I am getting this error: "no suitable constructor exists to conv...
[5 replies] Last: Example with helper methods for parsing and outputting Cost s to stre... (by icy1)
.txt file question
 
Hey all, I have a big program project that I'm working on that's supposed to do the following: "The multiple mailings option of your menu should read a text fil...
[12 replies] Last: Hey Handy Andy, Thank you so very much for your time and dedication t... (by cmangum3)
When ever I try to run this program Eclipse immediately crashes
 
I tried double checking for infinite loops but I can't seem to figure it out. Please help? #include <string> #include <sstream> #include <iostream> ...
[3 replies] Last: it is not legal to make a run-time array. Some compilers will do it, b... (by jonnin)
Simplest way to concatenate String + Int?
 
I have a String and Int that I want to concatenate together. An example: String a = XY4THFUD39TH int b = 7644500 where the outcome should become XY4TH...
[6 replies] Last: Variadic style #include <iostream> #include <string> #include <sstr... (by megatron 0)
(2) simple -- for loops program:
 
// #1 // Enoizat, // Let me just "refactor" your source code a bit ^_^ #include <iostream> using namespace std; int main() { int const whatIsThisVa...
[2 replies] Last: @rjphares, you probably also want to remove the local variable a in ... (by boring)
Read from file until certain number
 
Something like this, perhaps: #include <iostream> #include <fstream> #include <vector> #include <sstream> bool read_numbers( std::istream& stm, std::vector<i...
[2 replies] Last: The problem is that you read -0, then you read the next number (3), so... (by boring)
Space at the end of my for loop.
 
i notice that in my for loop that prints out the values and a space between them, is adding an additional space and the end of the last number it prints out. H...
[5 replies] Last: @tbp, good solution, although I think you should #include <cstddef> ... (by boring)
Image conversion + ftp uploads.
 
Hello, I'm currently working on a project that will take an image input, and then convert its resolution to multiple others, eg from 1024 x 768 to 1920 x 1080 e...
[2 replies] Last: For the image you might want to use CImg: http://www.cimg.eu/ For th... (by coder777)
Not getting my array printed out
 
Why is that I do not get the array myData outputed? ALl I get is a hex number 00BB8000 #include <iostream> using namespace std; int myData { 3,4,5,6,44,0...
[2 replies] Last: Because myData is an array of ints, when you use it, it's just like ... (by boring)
Beginner w/ C exercise
 
Would somebody be able to guide me through this exercise? Write a program that displays the contents of a file at the terminal 20 lines at a time. At the en...
[4 replies] Last: If that works, then you must add conditions: while ( fgets(buf,1000, ... (by keskiverto)
if else error
 
Ive got an error in the select_AC function. The error I get is uninitialized local variable A,B,C,D,E,F,G and don't know what to put instead. I want to retur...
[5 replies] Last: When you write char A; , you're saying that A is a variable that wi... (by boring)
unresolved external symbol LNK2019
 
Hey, first time posting here, I read the "read here before posting" but apologies if I mess up. I'm trying out inheritance for the first time and came acros...
[7 replies] Last: Well not sure where I went wrong the first time, but everything appear... (by Ihop222)
April 2018 Pages: 1... 34567... 25
  Archived months: [mar2018] [may2018]

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