Beginners - October 2019 (Page 15)

Segmentation Fault, Dynamic 2d Array Part2
 
I've found what part of my code is causing the segmentation fault but I don't know why. Can anyone help to fix and explain? The program is a version of lang...
[5 replies] Last: The values I've been testing are Board size: 10 rows, 10 columns xRow... (by stephcat5)
by lexa19
Insert user input into mysql
 
Hi! I have this piece of code, I want to write the user input into db. The problem is that the variables are of multiple types, int and strings. What am I doing...
[4 replies] Last: the database insert statement should work exactly like it would in a s... (by jonnin)
How to prevent the latter function from being called twice
 
In my visual tictactoe game, I check for a win like so: void HelloWorld::CheckWin(int x, int y) { Check3PiecesForMatch(0, 0, 1, 0, 2, 0); Check3PiecesFor...
[5 replies] Last: Thanks @jonnin , and Glad to have your 5500th post :D (by closed account E8A4Nwbp)
Someone who can correct my code, please
 
#include<iostream> #include<fstream> #include<conio.h> #include<iomanip> using namespace std; struct Student{ char surname ; }; void seeStud...
[7 replies] Last: Hello MazeStuck, This should help to get you started: /* 1)Given a ... (by Handy Andy)
Looking for some advice on that piece of software to create
 
Hello, I need to create a piece of software that includes a data structure and a search function, but I am really struggling for ideas. I am only in my 1st year...
[3 replies] Last: Thanks I will look into these options (by MyOnlinePersona)
Bubble sort with random array
 
Hey so I am writing a program that sorts a randomly generated list five different ways (bubbleArray, selectionArray, insertionArray, quickArray, and mergeArray)...
[2 replies] Last: So I am trying to take it piece by piece and here is how I am trying t... (by CodingIsHard17)
Reading secret messages
 
Instructions: A local company is developing a way to pass multiple messages to multiple places at the same time. It is one of those secret companies. You are ...
[6 replies] Last: For anyone that needs help. I got it working. Just have to clean some ... (by XboxOne2019)
Bar Graph Manipulation assistance
 
Here is my code for population growth. The output is nearly perfect, I just need the '*' to be beside the date and then endline to the next year. As well as, di...
[1 reply] : #include <iostream> #include <fstream> #include <sstream> #include <i... (by lastchance)
C++ E0413 I want pushback with a Pointer
 
Hi i have problem with my code. I want use pushBack with a Pointer. But when i use it E0413 appears. How i can fix this. I dont want use vector beac...
[3 replies] Last: > I dont want use vector beacuse its destroys everthing. > I can^'t us... (by salem c)
by maryt
time complexity of recursive function
 
Hello. I would like to ask the time complexity of this function. Can you please provide a method of calculating the complexity? int guesswhat(int n, int...
[3 replies] Last: you are welcome. Even if the loop changed N, the answer is the same ... (by jonnin)
Time complexity of matrix addition
 
Implement the addition of 2x2 matrix in c++ and then give the asymptotic running time in O notation of it.(Note: Implementation should not be hardcoded and also...
[3 replies] Last: matrix addition is O(N) where N = rows*cols or its N*N if you consider... (by jonnin)
Unexpected answer
 
The answer is ZERO 0. Why. Please explain #include <stdio.h> int main() { int p=100,q=5,r=50; int m; m = p == (q+r); printf("%d",m); ...
[3 replies] Last: Thank you (by Beginner of C)
Looking for libg++ library
 
Hi, I was going to have a go at updating some old code, and I wanted to make sure that the original coder didn't make some changes to the original libg++ fil...
[2 replies] Last: Thank you, I really appreciate that. (by CraigAB69)
cout not printing full string?
 
Why does this code only return ss, as opposed to sss? int main () { string s="ss"; s ='s'; cout<<s; }
[3 replies] Last: is probably ok due to small string / other general luck that the cla... (by jonnin)
array of class member functions
 
Can someone help me? #include <iostream> using namespace std; class a { public: void function(){ cout << "hi" << endl; } void...
[1 reply] : #include <cstdio> #include <functional> #include <array> struct a {... (by mbozzi)
Segmentation Fault, Dynamic 2d Array
 
Hello, I'm trying to initialize my dynamic 2d array (a gameboard) to blank or '_' or something along those lines. However, no matter what character I put in my ...
[1 reply] : > board = '_'; You probably want your loop variables her... (by salem c)
C++Tutorial for Beginners 34 - Overloading Constructors (Following this tutorial)
 
I'm following cave programmers tutorial in which in cpp file visor.cpp it shows me an error with Visor::Visor(string newName) and upon compilation it shows me a...
[1 reply] : what is the error? (by malibor)
Passing Pointer as Parameter
 
Long story short, I'm doing a version of Langton's ant for a class. It's the first time I've had to really split up code (assignment requires it) so I'm passing...
[4 replies] Last: Heh, here’s a Tcl/Tk script to play with it. https://www.activestat... (by Duthomhas)
by kwaifu
Get data using ifstream
 
Hello. I'm trying to get the information from a .txt file and using it on this program. My problem is, that when it compiles, I get numbers like -85546484968 ...
[8 replies] Last: OH ! I erased the ints from the line 63, and I added the '&' before a... (by kwaifu)
Multiple function use and returning a value from a function
 
I have to Write a function named inputVal() that prompts the user for an integer and uses a loop to validate it using the minimum given in the parameter set. Us...
[6 replies] Last: Hi, I read the question again. The question says "prompts the user for... (by ray210618)
October 2019 Pages: 1... 131415161718
  Archived months: [sep2019] [nov2019]

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