Okay guys thank you for your suggestions, basically when I think about your suggestions, that is how I would handle it in C, giving pointer as parameter and returning a value.
In the method decode...
Type: Posts; User: High Voltage
Okay guys thank you for your suggestions, basically when I think about your suggestions, that is how I would handle it in C, giving pointer as parameter and returning a value.
In the method decode...
If I decode function returns dynamically allocated memory I still have to delete it after function call? What about returning references is that any safer, but then other question raises, since I...
Hello C++ experts, I am having a problem with system (microcontroller) stopping after some consecutive method calls, and I am pretty sure it is because of my incorrect pointer handling and corrupting...
I haven't even noticed it. Thank you Salem, I knew that it was something simple.
After searching through google and not being able to fix the problem, I decided to ask here.
So I am trying to implement inheritance, but unfortunately I am getting compiler error:
...
Hello guys, I am implementing my little protocol to send data to from microcontroller to PC via RS232. I would like to know if there is a way to determine size of a buffer passed to a function,...
Thank you it compiled now.
Salem this is not my code, I copy/pasted it from msdn site as I mentioned at the end of my post. I tried removing stdafx.h and turned off VS option "use precompiled headers"
about website:...
Hello C++ experts,
I would like to ask someone who already used C++ for windows socket programming. I am getting following errors:
identifier "Winsock" is undefined and many redefinition errors...
@Salem thank you.I didn't even notice it, you are right I mixed up I2CTransmitter and LCDTransmitter classes. I thought all the time that I used LCDTransmitter but instead I wrote I2CTrasnmitter... I...
I am fighting with the GCC compiler, problem occurs in the constructor of the LCD class, when I try to instantiate new LCDTransmitter:
this->i2cTransmitter = new I2CTransmitter(i2cAdapter);
...
SOLVED:
OK I got it working, The map function was the problem... somehow it didn't map the values right.
Analog Refrence Voltage is 5V for reading the analog values. And guess what, pin that...
Hello everyone,
I am implement using joystick as Password Logger, where Joystick remembers 3 out of 4 UTTERMOST positions, and the combination of the THREE joystick positions represents a PASSWORD....
Well some people say that references act as they were pointers , and depending on the compiler they could be implemented as pointers or not, maybe your compiler doesn't implement it as pointers and...
I understood that references can be used as aliases
class Foo
{
private:
int x;
public:
*this gives us object, but object is just a memory address, as it is any variable in C++, that is what I actually meant, am I right?
I am aware of that, just trying to understand references
...
hope I understood you laserlight well, this is how I see it now
https://s1.postimg.org/94pu6wotb/Untitled.pngimage hosting 5mb
Hello guys, I am trying to understand the implementation of references in C++, after some research and reading this article: An Insight to References in C++ - CodeProject
I concluded that...
Thank you algorism,
this line:
Date *date = malloc(sizeof *date);
Why do you take sizeof pointer, I thought it should allocated like this
Ignore i variable forgot to remove it and also accidentally put const in free function.
I don't understand Why do you pass double pointer in free function instead of a single pointer?
Also why...
Thank you salem.
So I can look at function pointers simply as data fields of the class/class variables?
MyClass.h
class MyClass
{
private:
Alright I have another qeustion.
After trying to call
nDayOfTheWeek = date->getDay(date, aDate);
date->Delete(date);
which are struct functions that are implemented via virtual...
I am using GNU GCC compiler, I don't think I am allowed to compile in C99 mode because other old programs maybe would not compile in that case.
I am getting following errors:
Src/_Date.c: In...
Hello everyone,
I am trying to initiliaze Date struct fields that are array type in a function
Date* new_Date(int day, int month, int year, int i)
, but I don't know a proper way to do it
...
Originally it was saved as PNG
https://s11.postimg.org/d1039cy2b/UML_Diagram_I2_C.pngupload pics