Beginners - March 2019 (Page 8)

C Program Question
 
The smallest number in the array is 2, but for some reason my program is saying the smallest number is 1, which isn't even in the array. The part in the code th...
[6 replies] Last: @mysiarobin1987 I added in the swap in section e. #include <stdio.... (by whitenite1)
bitwise shift confusion
 
why they print differently, both in clang and vs c++ t1= 0000000000000001; 1 t2= 1111111111111111; -1 #include <iostream> #include <bitset> int ma...
[4 replies] Last: C++17: The value of E1 >> E2 is E1 right-shifted E2 bit positions. ...... (by JLBorges)
Program not swapping correctly
 
In part (e), 2 and 34 should be swapping places in the array but instead 5 and 34 are swapping. Any help would be greatly appreciated, thank you in advance! ...
[2 replies] Last: thank you so much lastchance for your patience! i got it now! (by mysiarobin1987)
by vysero
Help understand whats happening in this function
 
I need help to understand whats happening in this function: void trackDeviceIDs(uint8_t source, LibPlatformHardware::CCANNotifier::SCanMsgData& data) {...
[3 replies] Last: yes shifting zero has no effect. shifts multiply or divide by 2 per ... (by jonnin)
[Problem] Operator Overloading +
 
Write your question here. Dear C++ Community I have encountered a problem when trying to overload the '+' operator to add two Money objects rands and cents. ...
[3 replies] Last: Thank you. I really appreciate all your help. (by NovaPrimeveera)
Code not reading in Array from .txt file?
 
I seem to be having a problem reading in an array from a .txt file. I am looking to use a binary search to search an array so that the position of the number en...
[5 replies] Last: Hello EarlyProgrammer, Something that occurred to me while testing yo... (by Handy Andy)
by Alb13G
Having Problem With a Function. Need Assitance
 
Write your question here. I'm having a problem with the final function "orderTestAbs". The first 2 work fine. I'm not sure how to use absolute values in it or ...
[4 replies] Last: Thanks a lot salem c, appreciate it ! (by Alb13G)
Cant use 'auto' in my class.
 
Hello, I want to create auto lastDataSendTime = std::chrono::system_clock::now(); in my class, because I got error: 'auto' not allowed in non-stati...
[5 replies] Last: If Misc::sendData is not a static member function you need to pass the... (by Peter87)
Complilation problem
 
Hello I have a problem: I have 4 files: AllOnesGA.cpp, Population.h, Individual.h, GeneticAlgorithm.h In AllOnesGA.cpp I wrote in main(): GeneticAlgorithm ga...
[1 reply] : ¿are we supposed to imagine your code? you didn't provide a prototyp... (by ne555)
flexible array member
 
Hello I have a problem: I have 4 files: AllOnesGA.cpp, Population.h, Individual.h, GeneticAlgorithm.h In Individual.h I declare private: int chromosome ;...
[4 replies] Last: who knows ISO C++ forbids flexible array member (by ne555)
by Delcho
Problem with lvalue
 
Can someone tell me why I get an error message using temporary as lvalue [-fpermissive] on k.back().koef+=front().koef; #include<iostream> using namesp...
[3 replies] Last: Here's a minimal program that also makes the same error message, in ca... (by Ganado)
by vysero
Accessing an array from a diffrent class.
 
If I create a function in one class that returns an array then, in general, how can I assign that return to a new array in a different class? For instance, I cr...
[1 reply] : Maybe you spelled versionVector wrong - check your capitalisation. Ma... (by salem c)
How to display rows of asterisk, incrementing or decrementing, with user input?
 
Full Disclosure this is a HW assignment. But I already turned it in last night so I'm sure I got a d or c. I just want learn know how to do this correctly. T...
[1 reply] : This should produce something interesting. for (int col=1; col... (by salem c)
Compilation problem
 
Hello I have a problem: I have 4 files: AllOnesGA.cpp, Population.h, Individual.h, GeneticAlgorithm.h In AllOnesGA.cpp I wrote: #include "GeneticAlgorithm....
[1 reply] : Maybe because it should be # include "Population.h" (by salem c)
Can I initialized variable only once in while loop ?
 
Hello guys , I would like to ask a simple question which is can I initialized variables only once in while loop ? Here is the code , it is working fine but I wa...
[1 reply] : As you can see that I have to initialized the variables multiple tim... (by AbstractionAnon)
Dynamic Array Initialization
 
Hi, I believe I'm having an error with initializing my dynamic array -data-. I'm not 100%, but the sum value comes out to be 0 when the program is run, and it'...
[3 replies] Last: to clarify new int {} initialise all the elements to 0 new int (n... (by ne555)
"Segmentation fault (core dumped)" Error (1,2)
 
-------------------------------------------- Please check the most recent comments for the latest questions. Thanks! --------------------------------------...
[20 replies] Last: Does sort() use < so it is checking the struct object contents and fi... (by coder777)
Doubt in Abstract Data Type list
 
Hi, I just started learning c++, in my classroom the teacher wrote code of static list using class template, the list is based on an array, it works fine for w...
[2 replies] Last: Thank you ne555, it is clear now with your explanation, yeah I should ... (by sme89saulito)
unique_ptr , how to create and use
 
Thanks JL but stillI am stuck in this Insert function at the marked line. Node* LinkedList::insert(Node* pos, const std::string& value) { // pos po...
[8 replies] Last: Solved: Node* LinkedList::insert(Node* pos, const std::string& value)... (by olefredrik)
Unable to add watch on a class variable
 
I have a string array data declared as a private variable in my class header file and being used in my class cpp file. I am trying to debug and observe whether...
[10 replies] Last: Also, just be clear: Note that char is a type of int (just smaller ran... (by Ganado)
March 2019 Pages: 1... 678910... 25
  Archived months: [feb2019] [apr2019]

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