Beginners - August 2017 (Page 13)

Thinks char I declared is const char *
 
Sorry for the second post in a short amount of time, but for some reason, I'm getting this error: invalid conversion from 'const char*' to 'char' [-fpermissive]...
[4 replies] Last: Oh thanks, that makes sense. Glad to know that (by onlinone22)
Empty string after cin >>
 
First I ask the user if he wants a method or another (1 or 2) After processing that I start reading lines with getline to store them in a string vector, but th...
[3 replies] Last: Since the problem is quite common, you can find a lot more about it on... (by Enoizat)
how to check if the a recursive scan is pointing to the folder from which it started its recursive scan
 
how to check if the a recursive scan is pointing to the folder from which it started its recursive scan ? Let's say I am starting my recursive scan at folder ...
[6 replies] Last: Something like this, perhaps (the part which prints out the contents o... (by JLBorges)
fstream not Working
 
Hi. For some reason, the std::cout never prints a value, despite there being items in the .txt file I created. What am I doing wrong here? Thanks in advance!...
[4 replies] Last: @helios, thanks for the response! Your explanation made perfect sense... (by onlinone22)
Specific cases of operator overloading. Why do the cases matches the snippets?
 
This is the exercise: struct A { A(int a_) : m_a(a_){} A& operator +=(A const& rhs_) { m_a += rhs_.m_a; //m_a = m_a + rhs_.m_a //then b = a + 1? ...
[11 replies] Last: I understand i.e: operator+() is a free function and operator-() i... (by puertas12)
How can i create an array of 10^9 size?
 
I have a project on school and i need to store 10^9 random numbers in an array for this purpose. I have tried a lot to do that but nothing is working. How can i...
[7 replies] Last: [quote=JLBorges]The amount of storage available in the run-time stack ... (by Enoizat)
forward a struct with a unique_ptr
 
I'm attempting to pass a rvalue struct, which has a unique_ptr as one of its members, as an argument to a member function, which then uses the rvalue in a std::...
[1 reply] : Use std::forward only with forwarding references (to propagate th... (by JLBorges)
What should we do if we want to create a custom random number generator class?
 
Can anyone explain how to create a simple class that produces random numbers, I mean a custom class without including CSDLIB and pre-defined rand() function? M...
[11 replies] Last: If you want to have some very simple fun, make a PRNG using von Neum... (by Duthomhas)
remove_copy_if
 
Just practicing algorithms. Can anybody point out why temp is null after using remove_copy_if #include<iostream> #include<exception> #include<algorithm>...
[5 replies] Last: [quote=Peter87]That's why he used std::inserter Too right!! Thanks a ... (by Enoizat)
by Kuluoz
How to clear Header File Problem?
 
my.h #include <iostream.h> #include <stdio.h> typedef struct book { int bookindex_num ; int bookprice; }mybook; i was create this header fil...
[7 replies] Last: You should also decide in what language you want to program. Is it C o... (by Enoizat)
How do I rename an existing file using c++
 
How do I rename an existing file using c++?? is there any function in fstream ?? Thanks in advanced.
[5 replies] Last: Thanks man , You are awesome :) :) (by rajhansk)
Accelerated C++ istream question
 
I'm in chapter 5 and there is a thing I don't understand. When creating for example a function to insert input words to a vector why does the book put if (in) ...
[4 replies] Last: Oh, I see. Thanks! (by AwesomeGuy)
What C++ standard follow the version gcc 4.6.4?
 
I'm having some problems with the type "auto". So I'm wondering if I am using a gcc version previous to the standard C++11. I checked the the gcc version on ...
[3 replies] Last: Check from the manual of your installed gcc % man g++ the descriptio... (by keskiverto)
by pizza
return statement
 
What are those extra and seemingly pointless return statements in the void functions ??? What does it do? does it make any difference and is there any case wher...
[3 replies] Last: Ah, good man. Glad to have helped. (And sorry to have mis-thought.) (by Duthomhas)
by paulm
Initialise array in struct - incompatible type error
 
Hi, I'm fairly new to C++, and I'm running into a problem with initialising arrays in structs. My struct contains two arrays, but when I initialise the struct ...
[4 replies] Last: As said, I'm developing for Arduino in Eclipse. My GCC is version 4.9.... (by paulm)
Multiple Inheritance
 
This is my first time using multiple inheritance. Could someone please help me fix/explain what I did wrong? Here is what outputs when I compile: cd 'C:\Us...
[5 replies] Last: VenusPilot(string skin, string skincolor, string language, string ve... (by TheIdeasMan)
strings to char array
 
Guys, I'm having a problem to copy a string to a char array; I need to read two strings and than put the content of them into a dynamically allocated char arra...
[5 replies] Last: I only gave the option because I wasn't actually sure whether the OP w... (by lastchance)
[Date Class] Question/Review
 
I am currently writing my first class. The program is supposed to get month, day, and year information, which is validated by member functions, then output to s...
[4 replies] Last: Does it make sense to use "pragma once" AND include guards at the sam... (by Misenna)
Odd error
 
My program was working fine last time I had worked on it. Though when I tried to run it, it failed to compile and gave an odd error message of 'relocation trunc...
[3 replies] Last: @mbozzi Sorry, I'm still trying to get used to programming in C++. Wha... (by Griffinflame21)
OS X Socket issue - can someone help please?
 
I have a server/client program. Server written in C++ and client in Python. Python client works. I am unsure how to actually get this connection to write to...
[no replies]
August 2017 Pages: 1... 1112131415... 17
  Archived months: [jul2017] [sep2017]

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