Go to advanced search

by mthinkcpp
Mon Apr 07, 2014 2:22 pm
Forum: C/C++
Topic: Running shell command in C++ code
Replies: 4
Views: 5316

Re: Running shell command in C++ code

To run a command use:

Code: Select all

#include<stdlib>
system("[bash cmd]");
by mthinkcpp
Sun Jan 19, 2014 1:18 pm
Forum: C/C++
Topic: is there a real advantage to use C++ over Python?
Replies: 42
Views: 12509

Re: is there a real advantage to use C++ over Python?

Unless perhaps you want to get into kernel module writing and or adopting a kernel modified for real-time use. As far as I understood the kernel was suitable for real time use (Google, Space Probes). It is the user-space software that may not be, and would have to be custom engineered to suit the s...
by mthinkcpp
Sat Jan 18, 2014 7:11 pm
Forum: C/C++
Topic: is there a real advantage to use C++ over Python?
Replies: 42
Views: 12509

Re: is there a real advantage to use C++ over Python?

@DouglasLawson A code optimizer is part of all (good) compiler collections (like GCC and LLVM). This component optimises your code and uses the optimal CPU instructions to make your code run as fast or faster than the equivalent in assembly. It does this in a tiny fraction of the time (<1s) compared...
by mthinkcpp
Sat Jan 18, 2014 11:56 am
Forum: C/C++
Topic: is there a real advantage to use C++ over Python?
Replies: 42
Views: 12509

Re: is there a real advantage to use C++ over Python?

On another hand, C++ is better for performance and for a small device and a program which need speed and high availability like my project. Indeed. But this is the opinion of one who likes C++. dougui is thinking on the right lines. A C++ programme will be faster. The high-availability will be cont...
by mthinkcpp
Fri Jan 17, 2014 6:49 pm
Forum: C/C++
Topic: Best programming environment
Replies: 6
Views: 2555

Re: Best programming environment

Options for compilation: 1. Compile on the RPi. 2. Cross-compile, install the gcc cross-compiler. gcc-arm-none-eabi This has the best of both worlds, fast compilations and the result runs the the RPi. Copy the resulting executable across using something like scp. Compile using arm-none-eabi-gcc. Not...
by mthinkcpp
Fri Jan 17, 2014 6:34 pm
Forum: C/C++
Topic: is there a real advantage to use C++ over Python?
Replies: 42
Views: 12509

Re: is there a real advantage to use C++ over Python?

Very good Python or Java programmer can create code that will be both smaller and faster, than C++ code written by average C++ developer. Proven many times. I disagree. Instead you should say 'A poorly trained programmer in any language will write slow code', and even that isn't always true for all...
by mthinkcpp
Tue Jan 14, 2014 5:45 pm
Forum: General programming discussion
Topic: HELP: Writing a program to read Linux partition from Windows
Replies: 9
Views: 2200

Re: HELP: Writing a program to read Linux partition from Win

It looks like I can use CreateFile, but it looks like it is a WinAPI and I don't want to depend on Windows for anything, if I can help it. I'm not sure how you intend to use Windows to read a file without depending on Windows' internal functions. Using them will be compulsory if you are looking to ...
by mthinkcpp
Sun Dec 22, 2013 12:43 pm
Forum: C/C++
Topic: C++
Replies: 7
Views: 2654

Re: C++

I recommend Programming - Principles and Practice, by Stroustrup (http://www.stroustrup.com/programming.html). It is aimed at those new to C++ and it covers all the necessary programming practices in C++.
by mthinkcpp
Sat Oct 05, 2013 8:24 am
Forum: C/C++
Topic: C / C++ - Draw a hairline cursor - how to?
Replies: 1
Views: 968

Re: C / C++ - Draw a hairline cursor - how to?

I doubt you need to use an image to display it. Your GUI library should have a facility for drawing lines, which you could have arranged as a cross hair. For how to do so (draw lines), look in your GUI library's documentation. To move the lines for each time they are adjusted, look up event handling...
by mthinkcpp
Wed Sep 11, 2013 5:31 pm
Forum: C/C++
Topic: clang 3.3?
Replies: 9
Views: 4361

Re: clang 3.3?

There are debian armhf repos: http://packages.debian.org/sid/armhf/libclang-3.3-dev/download But the Debian armhf repos target ARMv7, whereas the Raspi only has an ARMv6 CPU (i.e. the Debian armhf binaries won't run on the Raspi). That's why the Raspbian project was created - to recompile the whole...
by mthinkcpp
Sat Sep 07, 2013 4:32 pm
Forum: General programming discussion
Topic: C or C++
Replies: 17
Views: 4332

Re: C or C++

I suggest you learn C, then learn C++. C is a subset of C++ and C++ is an Object-Oriented Language. I prefer C over all of the languages, because I have more control that way. It's really up to the programmer to decide which language fits them best. Then again, you could just learn C++, but I feel ...
by mthinkcpp
Wed Sep 04, 2013 5:14 pm
Forum: C/C++
Topic: clang 3.3?
Replies: 9
Views: 4361

Re: clang 3.3?

There are debian armhf repos:

http://packages.debian.org/sid/armhf/li ... v/download

Edit:

On looking at the provided link, it seems that it should be 'sid' instead of 'unstable' for the /etc/apt/sources.list.

So:

Code: Select all

deb http://ftp.uk.debian.org/debian/ sid main
by mthinkcpp
Sat Aug 31, 2013 12:31 pm
Forum: General programming discussion
Topic: C or C++
Replies: 17
Views: 4332

Re: C or C++

In ALL applications C++ is at least equal to C in all areas , and is superior to C in minimising programmer errors (i.e. In C++ you cannot call a function with arbitrary argument if none are specified, in C you can), and (as I am about to list) has other advantages. In performance C++ does beat C w...
by mthinkcpp
Fri Aug 30, 2013 1:05 pm
Forum: C/C++
Topic: clang 3.3?
Replies: 9
Views: 4361

Re: clang 3.3?

For binary installation of libclang

Edit /etc/apt/sources.list and add the line

Code: Select all

deb http://ftp.uk.debian.org/debian/ unstable main
Then run

Code: Select all

apt-get update
apt-get install libclang-3.3-dev #or libclang-3.4-dev instead
by mthinkcpp
Wed Aug 28, 2013 12:18 pm
Forum: General programming discussion
Topic: Speed: Python vs. C++ vs. C
Replies: 11
Views: 22964

Re: Speed: Python vs. C++ vs. C

C and C++ have exactly the same speed characteristics (as sprinkmeier said you can 'write bad code in any language', so depending on how you programme e.g. your C code could perform worse than your Python code). However some of the C++ abstractions, allow more general code, that runs faster than the...
by mthinkcpp
Mon Aug 26, 2013 4:22 pm
Forum: C/C++
Topic: C++ - QT4 - QTabWidget - Sub classing problem - protected
Replies: 2
Views: 1389

Re: C++ - QT4 - QTabWidget - Sub classing problem - protecte

When you created what test::myTabWidget pointed to you did: myTabWidget = new QTabWidget(centralWidget); It should be (untested), as QTabWidget is NOT your newly created class, create your class, not QTabWidget: myTabWidget = new ::myTabWidget(centralWidget); The ::myTabWidget is because your member...

Go to advanced search