Beginners - February 2018 (Page 14)

Why wont my read file open?
 
For some reason this code goes directly to the else statement. I have tried using the absolute path but fr some reason i get an error window pop up that crashes...
[1 reply] : Nevermind sorry how can i delete this post (by hoobahstank)
by geo28t
Logic error?
 
So for this function, it is supposed to remove any duplicate elements in an array and replace them with an empty string. It will also output the number of dupli...
[7 replies] Last: One obvious thing is that he clearly knows the STL. Better than wander... (by Thomas1965)
by unoino
Saving a char array into a char pointer for print function
 
What is the proper way to store a char array into a char pointer and printing it out ?right now it only prints out the first character of the name variable whe...
[5 replies] Last: Fair enough. I would ask what that conversion really looks like in ... (by jonnin)
HELP with Writing c++ statements to find a positive value that is divisible by both 11 and 12. (using while loop)
 
Write c++ statements to find a positive value that is divisible by both 11 and 12. Use a while loop. I am new to c++ please help! thanks So far this is wha...
[3 replies] Last: then there is no sensible place for a while loop. You just check 11 &... (by jonnin)
Using find in a vector of strings to find only part of the string
 
I have a file that contains phone number mapping in the form of: 4475825 9876523 The idea is to read the file into a vector called phoneMap which I have done....
[no replies]
Pointers and memory locations
 
My code is to read from a file, the id, maths score and English score and determine each of their grades using a function. How do I store the grades in memory...
[3 replies] Last: a good and fair question! first, modern c++ greatly reduces the need f... (by jonnin)
2d array with random numbers program
 
Hi all, I was wondering if I could have some help with logic for the following program prompt: 2) Please write a program that creates a 6 x 6 array where ...
[1 reply] : To give you an idea. #include <iostream> #include <random> int rand... (by chicofeo)
add 2 string number in c++
 
I have no idea why I can't compile my file // NOTE: The ONLY files that should be #included for this assignment are iostream, vector, and string // No ot...
[9 replies] Last: > const int a, const int b, and also const int hsum. why do you put co... (by JLBorges)
by Dr4g
Printing an output after a variable input.
 
I would like to know how to to print Line 11 and Line 13 in the same line but to enter variable in between of them. Like: Unesite cenu parkinga po satu . ...
[2 replies] Last: I wanted to print the second statement right after entering a variable... (by Dr4g)
by Baluv3
Converting C filestream to C++
 
I have reconstructed a C code to C++ but I have no clue what to do with the file stream. but I want it to be written with fstream.h can anyone do it for me in t...
[6 replies] Last: Can you do the same for other functions which has the reading from fil... (by Baluv3)
hex to dec in string
 
can someone explain it how it works? for example, A4h,for int base, does it mean 16^0 which is 1? but there is not function for it to be 16^1, 16^2, or more. A...
[3 replies] Last: c++ can convert string hex to int for you, if you didnt know that. Th... (by jonnin)
Structure and vector help pls!
 
Hi, I have a small problem when I use push_back to save a structure in a vector, the last value is repeated. #include <iostream> #include <vector> #includ...
[3 replies] Last: Change auto point #include <iostream> #include <vector> #include <s... (by arielga96)
asking for input after computation
 
So i ask for input, user enters 50, then program displays 1-55 and outputs the sqrt of pi. After I display the sqrt of pi, how do i bring up the "Please enter a...
[1 reply] : If you don't want to enter "s" just remove the entire loop on line 80. (by coder777)
Need help with my C++ program please.
 
So everything checks out for the most part. The problem comes when I press N. I tell the user say to enter in N when the user is finished. When the user enters ...
[2 replies] Last: Thanks for the reply and help. The N part was driving me crazy. I will... (by boypetey17)
Inheritance - out of scope error
 
For some reason my syntax is wrong and I'm getting an error. I am writing code to learn inheritance, composition, etc. I am making a Shape base class, which w...
[1 reply] : Hi, Try this: #include <iostream> class Shape { public: virtual ... (by TheIdeasMan)
Create An Adjancy List from Txt File
 
Hello, I recently started coding in C++ and I am trying to create a graph.I looked up some tutorials and I managed to create one.It works fine when I manually ...
[1 reply] : Something like this, perhaps: #include <vector> #include <map> #incl... (by JLBorges)
by logana
Problem with this code for an example of a Class.
 
I am using Visual Studio, 2015, and need help with this C++ code. The aim is to show a basic example of a Class using it's own Header file and to return three v...
[2 replies] Last: Sorted, all I needed to do was go into Project, options> and click C++... (by logana)
Recursive Binary Search
 
So i'm trying to write this recursive binary search but I need to do it with 3 arguments within int binarySearch(int array , int low, int high, int searchValue)...
[2 replies] Last: So I channged to this #include <iostream> using namespace std; int... (by matapexxxX)
Question ?
 
Hello , im new in the C++ world so my teacher ask me for a program and he type like this in the email : EX : #include <cmath> Write a program root of...
[2 replies] Last: Thanks (by yepicubef)
How to add in commas to output after reading a number from a file?
 
For example, the file says 13144 After reading in the number, how do I print it out so it says "13,144"? The complete assignment is this: Lab Exercise #6 Put ...
[2 replies] Last: I'm assuming it's ok to use the Standard Library for this(since the as... (by awong918)
February 2018 Pages: 1... 1213141516... 28
  Archived months: [jan2018] [mar2018]

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