Beginners - December 2018

by Tduck
Can you define two classes on the same source file?
 
I have an issue with a program I am creating that wants to use one object as a parameter. When I had first wrote the program, I ended up with huge errors regar...
[2 replies] Last: You just need a forward declaration for each class: #ifndef CLASS1_H ... (by dhayden)
Error
 
I don't understand what's happening?? #include<iostream> using namespace std; struct time { int hours; int minutes; int seconds; }time 1 ; voi...
[4 replies] Last: main() While we're here, that's very wrong. main returns an int ... (by Repeater)
Is it possible to use a string as a member name?
 
I'm using Gtkmm3 and I have a custom widget CustomWidget . I want to instantiate CutomWidget like so string name = "Account" + std::to_string(m_notebook.ge...
[4 replies] Last: AbstractionAnon I have fixed that in my github page, but still after p... (by bretjoseph)
Saving a row of a vector into another vector
 
Hello, I am learning c++ and I am currently at halt. I am trying to write a function such that: 1) It takes in input a one dimensional vector and an integer...
[1 reply] : > I starred the parts that are incomplete due to my lack of knowledge.... (by ne555)
FizzBuzz
 
Hi, I normally use the FizzBuzz test and try to see how many different variations I can do to get used to a language when first starting. I've successfully m...
[2 replies] Last: Thank you very much Ganado for your quick response! :) Yep, that was... (by IT Delinquent)
Helping out for GamePlay Multiplayer
 
Hello! I have been creating a game for 5 years! Can someone help me out now pls ? https://fundrazr.com/f1RFg6?ref=ab_b7mQAb
[1 reply] : Can someone please help me at least where i can find some help ? Plea... (by armando2)
c++ password storage + masking input
 
Hello everyone, I'm pretty new to programming - just starting out with C++. So I wanted to make an application - just for fun - which would mask user input with...
[1 reply] : Even thought maybe about encrypting data in that file, although I hav... (by helios)
by Spaget
Problem with program
 
Okay so i am stuck in this particular point in my program.So the program goes as follows:A menu of products shows up(the fuction metProPin(t,&pr ) makes it show...
[1 reply] : Line 26 is wrong. Whatever you try to pass to metProPin(...) &pr is... (by coder777)
Help with C++ writing to JSON
 
Hi, I'm making a game server and my database is in JSON format. However, I would like to know how do I check if a field exist in the .json file and add in the f...
[2 replies] Last: I would actually recommend boost PropertyTree. See: https://www.boost... (by coder777)
is program right??
 
i write a program that calculate the sum of first nine terms like(1/3!+5/4!+9/5!+....) i am not sure that is right or wrong... #include<iostream> using name...
[7 replies] Last: Thanks... (by Mehmood Umer)
by yat89
Moving the next value to the left to replace the removed value
 
Hi everyone. I am new to C++ programming. I need some help from anyone here. I got a task to remove two values which is 1 and 2 in 2d array. I had successfully ...
[10 replies] Last: Usually when you compile you can tell your compiler which standard ado... (by Enoizat)
Normal variable and pointer
 
Can you explain about bellow code?Why (na+1)=0x4? when a variable store stack or heap ? // Example program #include <iostream> #include <string> int main(...
[1 reply] : It's just an arbitrary value since you never initialized it. Try this:... (by dutch)
Interview Question that got me confused
 
There was an interview question a while back, which got me confused for a while and at the moment. Create a function such that Every time I call it, it must re...
[11 replies] Last: That's very nice too :) Edit: Grime, There's a few differences betw... (by Ganado)
Why cant you compare the value if an int type variables
 
Why cant you compare the value if an int type variables? For example: int a = v.size(); for(int i=0; v !=n && i<a; i++){} if(i<a){ return...
[13 replies] Last: @repeater That makes much more sense now I was unaware of this thank ... (by imperialcplusplus)
by veysel
difference static and global variable
 
hello friends, why we using static variables in a class according to global variable ? are they any special reason ?
[2 replies] Last: firstly thank you for the answer. What i understand that using global ... (by veysel)
For loop an array in a class which isn't main
 
I am trying to cout strings from an array which I want to use as a name of a widget in gtkmm but right now I just want to output the name, on compile I get th...
[3 replies] Last: Hmm thanks it now works even without the #include <string> ... (by bretjoseph)
outputting border of a square-nested loops and conditionals
 
I am writing some code such that: 1) you input the length of the side of a square and what you want to repeat 2) it then outputs the border of the square ...
[2 replies] Last: Perhaps if you renamed 'i' to be 'row' and 'j' to be 'col', things wou... (by salem c)
Looking for C++ Mentor, Willing to Mentor in PHP/JavaScript
 
Hello, I've been a web developer for 15 years, I've done pretty much everything with PHP and I'm well versed in Javascript, I'm looking to maybe skill-swap w...
[4 replies] Last: > User name: Brassware > This user does not accept Private Messages I'... (by salem c)
undefined reference to `sqlite3_open'
 
I would use sqlite3 db got this snippet #include <stdio.h> #include <sqlite3.h> #include <iostream> int main() { sqlite3 *db; char *zErrMsg = 0; ...
[2 replies] Last: thankyou for your answer unfortunately I'm really quite new to c++ ,... (by babydev)
Data types
 
I am writing something which could: 1) take a point 2) find distance to origin 3) compare to one before and submit closest one 4) if within 0.01 of origin ...
[3 replies] Last: When a number is used where a boolean value is expected zero will be t... (by Peter87)
December 2018 Pages: 123... 22
  Archived months: [nov2018] [jan2019]

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