|
Thanks a lot everyone, it's solved
|
|
|
|
|
You need to override the = opperator for the struct so that all the data is copied back.
Or use a pointer and pass it to the func, which is better, and a lot lighter on the stack.
|
|
|
|
|
Looking at the error there's probably a missing equality operator, but why's not obvious as we haven't got the full class definition.
And it's not better to pass a pointer rather than returning a value - a decent compiler C++98 compiler will implement NRVO which makes it just as efficient to return a value.
|
|
|
|
|
And the code ends up different to what you intend...
|
|
|
|
|
Hello community
I´m really interested in these subject, but i dont really how works implementation off ecc in hardware, did you ever did that for a hardware ecc with c++? ,could you show me maybe an example of a ecc implanted in hardware with c++?
Because im looking for a security for my hardware and i want to try ecc with c++ for my hardware ( µBIC).
Maybe anyone have a example code for a hardware with ecc in c++.
thx
|
|
|
|
|
|
Hi all,
I'm a newbie in Linux programming. I compile the "Hello world program" by means of gcc compiler in a Centos 6 host computer, with kernel 2.6.32. The command line used is gcc -static hello.c -ohello. Previously I have installed the GNUlibc (ver 2.12) in this computer.
The compile process is ok, and runs ok in the host computer (Pentium 4). When I copy the program to an embedded cpu with AMD GEODE LX800 processor and kernel 2.6.12, the running result is "error: illegal instruction"
I checked compile with different parameters in gcc command line: -mpc64, -m32, -march=i386, -march=geode with no results with any of them (compile is ok but running error "illegal instrucion")
I know a cross compiling is neccesary but don´t know the correct parameters to gcc to use
The code is as simple as this
main()
{
printf("Hello world\n");
}
|
|
|
|
|
i'm a new learner for C++
i want to use a easy software to practice
i need some advice...
|
|
|
|
|
Visual stadio will be ok 4 y
|
|
|
|
|
|
|
|
thx, i will try this software!
|
|
|
|
|
As an IDE, Visual C++ without doubt.
Plus I regularly use Notepad++ (use instead of notepad). Lightweight and cool.
"If A is a success in life, then A=x+y+z. (Work is x; y is play; and z is keeping your mouth shut.)"
|
|
|
|
|
my teacher advised us to use VC++
Notepad++ sounds cool!!
thanks for your advice!
|
|
|
|
|
Any time.
Best Regards !
"If A is a success in life, then A=x+y+z. (Work is x; y is play; and z is keeping your mouth shut.)"
|
|
|
|
|
Stay away from both codeblocks and NotePad++. Visual C++ Express provides everything you need, and it or its professional cousins, are the IDE of choice for most people who answer questions here.
Veni, vidi, abiit domum
|
|
|
|
|
It depends on what your host operating system is.
If you're running Windows then I'd suggest either Microsoft Visual C++ Express or MingGW and a text editor of your choice. From recent experience of teaching a couple of newbies Visual C++ was a bit of a cognitive load at the same time as learning C++ - you have to deal with some non-C++ bits that you have no idea about at first. MinGW is a bit simpler to get started with - the cognitive load is still there but spread slightly differently.
If you're running on Linux or something like FreeBSD then install g++ and use that.
|
|
|
|
|
notepad and a GNU compiler. Come on, do it the MANLY way!
|
|
|
|
|
At the very beginning I would recommend you to go with notepad + gcc. This would be very useful in order to understand the compilation model (how c/cpp/h files work) and linking. This is very useful/necessary knowledge that you need even when you are using an IDE with a larger project to help you in development. If you later switch to an IDE then on windows Visual Studio is by far the best. If you are using a better version than the free Visual Studio Express edition then you can use plugins/addons like VisualAssistX and Productivity PowerTools to make it even better. On MacOSX you can use Xcode. On linux code::blocks, this is a free ide that is crossplatform, available on all other platforms.
|
|
|
|
|
Code::Blocks is an excellent tool. Certainly, VS does have a larger feature-set than C::B, though one which provides little utility to many of us. There is precisely 2 features that I value it for.
The API reference (which doesn't come in Express versions) and the debugger, which I concede is second to none that I've used. I commonly create a VS project file simply so I can debug the program I'm working on. Too bad I can't debug Arduino code with VS also.
Other than that, it's slow, is visually unpleasant to me, is a large download, is a massive install (for an ide/compiler) and requires registration. It's also not available unless your platform is MS Windows.
My first compiler/ide/help file system went home on about 5 or 6 1.44MB floppy disks. (Turbo C++ 3.1)
Last time I grabbed VS, it was a 700MB download. Code::Blocks is currently 97MB.
VS Express for desktop apps requires 5GB of diskspace, C::B is under 500MB
Neither VS Express or Code::Blocks comes with a resource-editor. I use ResEdit for C::B, pr I use wxFormBuilder if working with wxWidgets. wxSmith is a bit crappy, imho - though it is integrated with the ide. wxSmith is the only wxWidgets resource editor I've seen that runs on the Raspberry Pi with Raspian as the OS.
Using this poor 4gb i3 win7 laptop of mine, I timed how long it takes to start the program, create a new console c++ project, paste the following snippet, build and run it.
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!" << endl;
return 0;
}
Code::Blocks 12.11 comes in at 52 seconds
Visual Studio 2010 Ultimate comes in at 2 mins 10 seconds
Though much of this time is in starting the program and parsing all of the include files.
Taking a larger project and allowing it to load first before hitting build - my pdf generator in this instance.
C::B build time: 14s
VS build time: 16s
VS debugger: 1st-class, 10 star rating
Code::Blocks debugger: de-what?
Each has its advantages, one should choose the application that best suits one's needs.
"Science adjusts its views based on what's observed. Faith is the denial of observation, so that belief can be preserved." - Tim Minchin
|
|
|
|
|
visual c++ 6 is very easy
|
|
|
|
|
Hi,
I have an horizontal custom QSlider without handler, and rounded corners.
My problem is when I set slider value to the minimum or the maximum (+-1px), and external corner is NOT rounded anymore...
It seems to happen when the slider value gets round radius, I hope I am explaining myself...
The stylesheet code is:
QSlider::groove:horizontal {
border: 1px solid #999999;
height: 8px;
margin: 2px 0;
border-radius: 5px;
}
QSlider::handle:horizontal {
width: 0px;
border: 0px ;
margin-right: 0px;
border-radius: 0px;
}
QSlider::add-page:qlineargradient {
background: white;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
}
QSlider::sub-page:qlineargradient {
background: red;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}
Thanks in advance,
Diego
|
|
|
|
|
What does this have to do with C,C++ or MFC?
Veni, vidi, abiit domum
|
|
|
|
|
you should probably ask this on a QT-specific site.
|
|
|
|