Beginners - October 2019 (Page 7)

by Bopaki
Program compiles OK! but bombs out when I run it
 
.Cannot work out what is the problem here: #include<iostream> #include<cassert> using namespace std; template <class elemType> class arrayListType...
[4 replies] Last: It works!!!! could not believe it...... here is what I have edited: ... (by Bopaki)
PlaySound in Eclipse
 
How I can open a .wav without this error: "undefined reference to `PlaySoundA@12'"? void ventoinhaligar(portaSerial *p) { p->enviaSerial(3); cout ...
[3 replies] Last: I needed to add library winmm to Eclipse. (by victorio)
Let a user choose how many sides are on a die and how many times it is rolled. Output the sum of all the numbers rolled.
 
Having some trouble on the last part of this question. I was able to make a die that rolls randomly and outputs the number. I was able to make 2 die roll random...
[1 reply] : http://www.cplusplus.com/doc/tutorial/control/ (see iteration) def nD... (by ne555)
by Nna
Scope of looping - error: status -1073741819
 
Hello everyone, I am desperately looking for the mistake in my code. I am implementing a CFD code and i don't understand why the method can't be run, when calle...
[9 replies] Last: > you don't need an array in the time (i) direction sure, if you only... (by lastchance)
by Reikon
Fstream help
 
Hi, I'm currently having trouble loading a file from a folder. I have 1 folder containing the code and inside that folder containing the file.txt. I have been t...
[7 replies] Last: Okay, Thank you very much, Jlb. and for the friends part. I was going... (by Reikon)
all prime numbers upto n using loop
 
how to find all the prime numbers using loops. i ve made a program using for loop but it doesnt print the required stuff. i ve built a logic but its hard to put...
[8 replies] Last: I gave you the answer, its the same about of code give or take a coupl... (by jonnin)
Is it possible to read from a file without fstream?
 
Can lines of text be read from a file without using fstream? More specifically, can it be read with only <sstream>, <string>, and <iostream>?
[7 replies] Last: I was just going to ask another question about redirection, but you ju... (by kaeru22)
Grades and Average
 
Good day programmers! I've look as much as possible in youtube videos analyzing and on many websites, but i think (in here will be the best) so for my proble...
[2 replies] Last: Hello philipmorries3, PLEASE ALWAYS USE CODE TAGS (the <> formatting... (by Handy Andy)
Using rand(), create a 20 by 20 block that prints "[#]" for solid and "[ ]" for open.
 
Had a homework question a few weeks back that I never got to finish because I couldn't for the life of me figure out how to do it. Now that it is past due, I wa...
[1 reply] : Please edit your with code formatting by adding "[ code]" and "[ /co... (by Ganado)
by medosz
asterisks in a form of triangles
 
I am trying to write a program that prints asterisks in a form of triangles. I would like to print 4 different triangles. I managed to do the first two. I would...
[4 replies] Last: Well it would be a hell of a lot easier if you chose meaningful variab... (by salem c)
Print a list in txt
 
How I can request the functions on main, because I used different classes. I need to run the functions "EscreveDados" and "LeDados". Thank you. void Escre...
[2 replies] Last: Thanks for reply, your help is very important. I will test and reply a... (by victorio)
Logical Operator
 
Guys, if the variable is declared, then how is it possible to initialize it? from declaration to initialization? like how to change it and put the input process...
[8 replies] Last: ok dude, thanks and to all of you <3 (by philipmorries3)
How can I only call the function once
 
This is my simple struct program struct outlet { string name; bool bankrupt; int worth; }; void isbankrupt(outlet shop) { if(shop.bankrupt) { cout<<"Na...
[7 replies] Last: No problem. I'm glad we could help! (by xmrfate)
segfault at c-string
 
#include <cstdio> int main() { const char * const name = "Rod"; char * ptr = (char*)name; *ptr = 'T'; std::printf( "%s\n", name ); ...
[2 replies] Last: Thanks, that makes sense. (by nuderobmonkey)
by HowieW
Trying to search for a players info within a score keeping log
 
I am trying to write code to enter in several Players names and scores, I got that part down. The next part is that I have to be able to search for a player and...
[5 replies] Last: The version that you have just pasted has two int main() and also star... (by lastchance)
Input validation
 
So it has come to my understanding that cin.fail() has some drawbacks, namely if, say, 1ssssss is entered, the input will be accepted. So I am trying to find ...
[3 replies] Last: The general rule with user input is:      The user will ALWAYS ... (by Duthomhas)
Replacing a specific part of a parent_path of std::filesystem path?
 
How would I go about replacing a specific part of the parent_path using std::filesystem? Originally I was converting an entry to a path then to a string like s...
[3 replies] Last: "notice a pause" At what point exactly are you noticing lag? Are you r... (by Ganado)
Min/Max
 
In C++ do the statements minimum and maximum work as they look? Sorry I'm unsure of the proper terminology. But can I essentially use min to find the smallest o...
[2 replies] Last: You can also use int min(int a, int b, int c) { return min({a,b,c... (by lastchance)
Computer sign-in/sign-out
 
So I've been trying to code a simulation in which you can sign into a computer in a computer lab. First you must enter in the lab you wish (1-4) and a seat. Eac...
[2 replies] Last: Yea I could use vectors,but I'm not sure how I should incorporate it. (by Deadweight77)
sum problem with functions in C
 
I'm a beginner with programming in C and I have a problem to solve at which point I get stuck. So my program reads numbers until the value 0 then it calculat...
[2 replies] Last: Thank you very much! I solved the problem. (by valiciousx)
October 2019 Pages: 1... 56789... 18
  Archived months: [sep2019] [nov2019]

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