Beginners - March 2018 (Page 21)

How to assign a text file to a c-string array
 
When the user enters an option, the file would be sent to the function that returns the amount of characters. #include <fstream> #include <cstring> #...
[1 reply] : Why are you messing around with C-style arrays? Use std::string To ... (by JLBorges)
finish this story plz
 
How do I extend this story like if I picked the number and I want the story to go even further? #include <iostream> using namespace std; int main() { ...
[no replies]
What syntax is this piece of code?
 
I am recently given some codes like that, filename extension is cc. I use ANSI C and C++ only but this code is not either as far as I remember. Though I read c...
[13 replies] Last: Thank you keskiverto. Looks like I am out of luck. I can't change too... (by user68627)
by fekt
Header File + Struct
 
I am trying to create a linked list for an assignment. I decided to create 2 header files, one for the class LinkedList and one for the struct.I also have one t...
[1 reply] : > has a problem ¿what problem? http://www.cplusplus.com/forum/article... (by ne555)
Need help with assigning user input
 
I know this is a very basic question but it is driving me crazy right now. I Am writing a program to determine the pay of an A, B, or C level author. The user w...
[2 replies] Last: OK, I believe I understand what you are are saying. .. So what about t... (by Mjimmie1)
reference to non static member function?
 
I'm testing out classes, and I'm confused on how to get past the error: "reference to non-static member function must be called; did you mean to call it with ...
[6 replies] Last: cout << dog.GetData; should be cout << dog.GetData(); GetData()... (by closed account E0p9LyTq)
Undefined reference error
 
Hi there! I'm having issues with a function I'm writing to implement the days of the week in a program. I'm trying to make a default class constructor and and a...
[2 replies] Last: And don't forget that you can initialize that static variable when you... (by jlb)
by ZLAPQM
explanation
 
found this code but still dont understand it i understand most of the main() function part but i'm not familiar with the string noBlanks part #include <i...
[2 replies] Last: It comes from here, for context: http://www.cplusplus.com/forum/beginn... (by lastchance)
Calculate GPA in C++
 
GPA = total grade points / the total credit hours In this assignment, you need to write a C++ program which can input a student’s courses data, such as how...
[2 replies] Last: ive read it over and over again and the more i read it the more confus... (by garza07)
Segmentation fault (core dump) error?
 
My program description is to create a program that takes names and scores as pairs and uses pointers and a dynamic array to store them. I am to then take those ...
[1 reply] : if ((det+u)->score > (det+u+1)->score) det+u+1 points off the... (by Repeater)
const char* vs. char*
 
I do not understand why there are red squiggly lines in line 22 (under "Hello World!" and line 29 (under =). Both indicate - A value of type "const char*" cann...
[7 replies] Last: Thank you JL. It works. (by phztfte1)
Copy constructor is not working
 
#include <iostream> using namespace std; class cmplex { int a,b; public: cmplex(int x,int y){a=x;b=y;cout<<"its insi...
[6 replies] Last: Thanks (by samir1996)
by ZLAPQM
combining conditions
 
i can add or subtract numbers fine but have trouble implementing a + / - sign numbers = 1 2 3 4 5 [these inputs are from a text file] total+=numbers #add...
[1 reply] : You can use negative numbers in the text file and still += to get the ... (by megatron 0)
delete element in array
 
good day, i have array program which will select a specific element in array and will be replaced by the last element after that it will delete the last element...
[6 replies] Last: ok that make sense. thanks again (by newguy17)
Connecting C++ to access 2013
 
Hey, I'm working on an application with C++, and i am in the phase where i must write some code to manage my database. the database is in access 2013. But i'am...
[no replies]
Finding the Average of a 2-D Array
 
My problem is as follows: A researcher has been given a grayscale image as a 2D array of floating point numbers. In a grayscale image each pixel value rep...
[5 replies] Last: Ok. Plain "8" or "64" is often called a "magic constant". It is not a... (by keskiverto)
by Dan298
Reading and sorting
 
Hi, I need help with an assignment. I need to read a list of names from a text file, sort the names alphabetically, and then output the names that would be firs...
[1 reply] : Line 56 is supposed to be } while (students == 30); // Note: == . '=... (by coder777)
by Neahle
How to lock mute button?
 
I was wondering how to lock the mute button, so you cant mute instantly, but will have to turn down the volume with "lower volume key" ? Thanks, Neahle
[no replies]
Can not access private variable with friend function
 
#include <iostream> using namespace std; class cmplx; class B; class A { private: int a=5; public: friend void fun(A); friend void fun(A,B); friend...
[2 replies] Last: Thanks a lot (by samir1996)
Prime number between two intervals
 
I am trying to get prime numbers between two intervals. I have a function is_Prime to check if a number is prime or not and returns true or false. I have anothe...
[1 reply] : while(bool is_Prime = 1) What do you expect from this loop ? Also you... (by Thomas1965)
March 2018 Pages: 1... 1920212223... 29
  Archived months: [feb2018] [apr2018]

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