Beginners - September 2017 (Page 4)

by chuvak
DO WHILE loop not behaving as expected
 
Hi forum, code is below. Everything seems to work as expected, but as soon as sin goes out of the to range, it just prints "Please enter your social...
[4 replies] Last: Hi, I would make some other changes too: I don't like the use of the... (by TheIdeasMan)
error: exited with non-zero status
 
i keep getting this error on my code and i can't figure out why. can someone please explain? if the user inputs: 4 3 4 4 7 it should output the message: Three...
[1 reply] : Hi, I ran the code and had no output but normal termination (returned... (by TheIdeasMan)
C++ for loop infinite
 
Hello all.. I am currently stuck on this for loop.. When ran, it keeps going and I need to stop.. Thanks in advance! FOR (i=0; i<199; i++) { FOR...
[3 replies] Last: Usually, identifiers in ALL_CAPS are reserved for macros. Because ma... (by mbozzi)
by Demii
Looping through and comparing two string arrays
 
Hi, I'm having trouble with a section of my code where i'm asked to loop through two string arrays, and compare the two for matching answers, and print incorr...
[6 replies] Last: Thank you for that example, that clears a lot up for me, I don't know ... (by Demii)
If and Else How to write more efficient
 
How would I write this code more efficiently with If and Else? #include <iostream> using namespace std; int main() { int score; // numeric test ...
[3 replies] Last: This is not a "with If and Else" solution: int convert2clamp( int mar... (by keskiverto)
Need Help on Polynomial Programming assignment
 
This is the first assignment for my CSIT 121 class and I am completely lost. The assignment is a pdf file on the link: https://oncourse.fredonia.edu/plugi...
[2 replies] Last: Plus, that PDF is behind a login wall :) (by Repeater)
End keys in c++
 
although my code doesn't accept end keys like "Home,End,Del,INS"...when i input end keys such as "Home,INS" it still happends...Can you help me to eleminate end...
[1 reply] : See documentation for getch() https://docs.microsoft.com/en-gb/cpp/c-r... (by Chervil)
why it gives me character eventhough getch() will return integer
 
Write your question here. #include<iostream> #include<cstring> #include<conio.h> using namespace std; int main(){ system("color a9"); char a; ...
[2 replies] Last: crystal clear...thanks repeater...you make my day (by phongvants123)
Error with OOP inheritence
 
Hy, I was reviewing OOP and got stuck on this exercise, but can't figure out what I did wrong... In these two lines cout << first.getAge << "\n"; cout <<...
[5 replies] Last: Funny, I did it in Visual studio, restarted it and now it worked. Than... (by spartannn)
Why do these two consecutive loops cause a segfault?
 
Why do these two consecutive for loops cause a segfault but one works fine on its own and both functions work fine in one loop. Please help I want to be able to...
[8 replies] Last: Just my 2 cents worth, but I think it's an important convention: IMO ... (by TheIdeasMan)
T' illegal use of this type as an expression
 
i want to check that the typename for a vector_set v is equal to class vector_set<int> class vector_set<long> class vector_set<unsigned char> class vecto...
[1 reply] : #include <boost/mpl/list.hpp> #include <boost/mpl/contains.hpp> usin... (by JLBorges)
Euler Method for DNA assembly
 
New to C++. I have absolutely no background in coding/programming but, at the suggestion of my PI, I'm currently taking a bioinformatics course. The purpose was...
[14 replies] Last: @Duthomhas no offense taken. I know a bit of R but, unfortunately, the... (by brownie206)
How can I read in an array of C-Strings from a text file?
 
For example, if I have: {camera lidar radar} from a text file and I wish to read from the text file and place "camera", "lidar", and "radar" as separate C-Sty...
[1 reply] : You need something that can find that text in the file. That means the... (by Duthomhas)
by Irhcsa
Pathing issue
 
So half of this works. When I type paint, it opens paint. I'm trying to get google chrome to open. I'm thinking I have the pathing wrong some how? I coppied it ...
[3 replies] Last: Thanks guys! (by Irhcsa)
error problems
 
im writing a function that will calculate the length of a players first and last name then swapping them if the length of player1 is greater than player2, but w...
[1 reply] : What is the type of player ? You do set it on line 1. Does type Pla... (by keskiverto)
Txt file help
 
I need to create a simple cryptography program that crypt a message shifting each letter to its right (on ASCII). And after that just make another code to make...
[1 reply] : What is meant is that you are "shifting" the positions of symbols in... (by Duthomhas)
Implementing c_str()
 
Hello, I try to write my own c_str() function of my own MyString Class. I wrote some code but not sure about its quality: const char* c_str() const//...
[6 replies] Last: I am apparently having an extra bad day @ c++. My apologies! (by jonnin)
searching text file
 
The read and write work fine but search always gives "not found". #include<iostream> #include<fstream> using namespace std; struct student { char name ; ...
[3 replies] Last: ooh thx guys.Obviously the file names had to be same.It didnt strike m... (by closed account 1vf9z8AR)
by klipwc
ofstream unable to access file no matter what
 
My main code was working a few days ago. Today I tried to run it again and it refused to write no matter what I did, so I used the simplest code I could write f...
[7 replies] Last: I made duplicates and placed them in all folders but it didnt work eit... (by klipwc)
eassy but difficult for me
 
what does 424811 mean ??? #include<iostream> #include<cstring> #include<conio.h> using namespace std; int main(){ system("color a9"); int b; co...
[1 reply] : Try it with line 8 int b = 7 You have just discovered undefined behav... (by closed account 48T7M4Gy)
September 2017 Pages: 123456... 21
  Archived months: [aug2017] [oct2017]

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