Beginners - February 2019 (Page 12)

call of overloaded function is ambiguous.
 
Hi, All I tried to run the following code on my gcc but encountered an error saying. " 38:9: error: call of overloaded ‘swap(int&, int&)’ is ambiguous ...
[2 replies] Last: Thanks Peter87 !! (by subhransu)
by vysero
|= and ? operations
 
I have a line of code here and I am trying to determine how the variable value is being calculated: value |= gpio_get_value(IOMUX_TO_GPIO(MX51_PIN_EIM_...
[9 replies] Last: The ! will convert 0 to 1 and any non-zero to 0. (by dutch)
string::npos
 
Hi so i have homework and its to clarify what the code means and what it does. if (numerals.find(romersk_nummer, 5) != std::string::npos)
[13 replies] Last: since we drug you down a long and winding road here, Ill just tell you... (by jonnin)
Virtual Destructors
 
Hello! I have a question regarding virtual destructors. When we inherit from a base class with a public access specifier, all public and protected fields and me...
[17 replies] Last: Alright, thank you all for the discussion :) (by Angela1998)
by Alb13G
if/else 'Y' response restaraunt program
 
When I enter a response OTHER than 'y', 'Y' or "yes" it doesn't go to the ELSE statement can anyone see why ? Id appreciate a response Thanks ! //Albert Gr...
[2 replies] Last: That's it ! Thanks so much nicholasjb1996 I just read that in the book... (by Alb13G)
by trjk
nan problem
 
hello beautiful people first thanks for your time second i know this code is a huge mess but the idea behind it is: the program generate a random x and y loc...
[2 replies] Last: hey salem thank you so much for all the information and am very sorry ... (by trjk)
Segemented sieve is useless!!!!
 
My brute force solution is working faster than the segmented sieve method for finding prime numbers in ranges which can be from 1 to 10^9!!!!. It's not only ...
[5 replies] Last: It depends on what you are trying to do. If you are just trying to fin... (by dutch)
String and Array
 
Hello guys, i am desperate how to fix this code. For example i have the string option; and then i want to use the string for numbers for an array for e...
[4 replies] Last: you can convert a string to an integer with std::stoi(stringvar) so it... (by jonnin)
Compile-time error dereferencing Map iterator
 
This is throwing a compile-time error: 'class string' has no member named 'first' (or 'second') for every instance of dereferencing the iterator. Below is a fra...
[10 replies] Last: Stanford's documentation is terrible; however, looking at the source c... (by aaronvan)
Passing a "string array" into a function
 
Hey, im doing a project for class and I have to convert a user entered number into roman numerals. I have 3 criteria to meet 1. read the conversion data from ...
[4 replies] Last: Dude thank you so much! Appreciate the help (by Caddyshack3000)
by cash
passing array of structure through function
 
I'm supposed to write a function that finds the maximum distance between two points created by an array. I'm confused about how to make a function that can pass...
[3 replies] Last: A minor improvement to Ganado 's excellent suggestion. To avoid check... (by dhayden)
Insert an element
 
Hi all, Here's the functions I have void FixedVector<T>::push_back(const T& value) { insert( size_, value ); // delegate to insert() leveraging er...
[3 replies] Last: Line 2: insert( size_ , value ); Lines 11&12: if (beforeIndex ... (by dhayden)
c++ checkout
 
...
[4 replies] Last: Hello imthekingbabyz, You could also do jonnin's suggestion as: if (... (by Handy Andy)
by Alb13G
if/else if
 
how can I ask the windy question should I change the structure or can I use more expressions in the if statement Can I get some help please the program asks ....
[6 replies] Last: I think Nicholasjb1996 is right: whether it's windy or not actually ... (by dhayden)
series calculation
 
Hello. why this code do not work correctly? #include <iostream> using namespace std; int main() { int N=10; int n; float S1; float S...
[6 replies] Last: It's not so much that S1 and S2 are floats ... it's that n is an int. (by lastchance)
Sorting a vector of nodes based on a struct attribute
 
OK so I've heard of sorting structs and I've heard of sorting objects based on attributes, but could someone explain how I would sort objects based on a struct ...
[1 reply] : http://www.cplusplus.com/reference/algorithm/sort/ std::sort( nodeve... (by keskiverto)
expected initializer before "std"
 
#include <iostream> int main() { int n,a,b,c,s std::cout<<"n="; std::cin>>n; a=n/100; b=n/10%10; c=n%10; s=a+b+c; std::cout<<"The...
[2 replies] Last: int n,a,b,c,s has no semi-colon. PLEASE learn to use code tags, it ... (by closed account E0p9LyTq)
by veysel
Data Structure
 
Hello Struct and Union are data structure in C/C++ as i know. Here my quesiton is that Class a data structure in C++ ?
[14 replies] Last: I see, sorry about that. (by jonnin)
binary '<<': no operator found
 
Hi, I am getting this error binary '<<' no operator found which takes a right-hand operand of type 'Point2D' (or there is no acceptable conversion) Having do...
[3 replies] Last: It not wrong to put the definition in the header, but your code will... (by helios)
by odo
this simple code giving error ?
 
it's giring error, sorry for rules #include<stdio.h> #include<stdlib.h> #include<math.h> int main(){ int a= rand(); int s=1;int i;int r; whi...
[2 replies] Last: thnks, i read every c is c++ so if you can show me c helping forum? i ... (by odo)
February 2019 Pages: 1... 1011121314... 23
  Archived months: [jan2019] [mar2019]

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