when to use C and when to use C++
I have been asked this question quite a few times and i wonder what
could the actual reason?
" When to prefer C over C++ or vice versa, of course this is for real
world pratical scenario"
As per my understanding, C++ makes it easier to program application
related logic as OOPS helps in that sense, but for some reason that is
not a reasonable explanation, could any one add on their comments?
> Hi everyone,
> I have been asked this question quite a few times and i wonder what
> could the actual reason?
> &qu...Using both C and C++ ISO standard libraries
(Originally posted as: another strange output?)
>I just recently was educated that I should be using #include <iostream>
>instead of using #include <iostream.h> as I had been doing.
>However, even though the education cured one strange output issue, now
>with the "correct" include spec I cannot get it to show the radix base like
>it used to using the "incorrect" include spec.
>Very much appreciate info as to what I am still missing. Code below
>#include <windows.h...Is it true you cannot use the ANSI C (not C++) standard library functions in the kernel?
I have a question about the use of the ANSI C (not C++) Standard Library
in kernel code for w2k/xp/vista.
I've been told, somewhat in passing, by a good kernel developer, that
the standard library functions (strcpy, qsort, etc) cannot be used in
kernel code because "you can end up coming out of them in the wrong
state". (We were talking about something else at that moment and he was
avoiding getting into the full explanation).
So, I'm not quite sure what he meant by that - I wonder now if he was
talking about calling conventions? in the DDK, all the...The use of the C++ standard
[I'm not positive if this should go here or comp.std.c++, so I hope
you'll forgive me if you feel it is off topic here.]
I've programmed in C++ for several years now (think 5 years seriously,
and maybe 8 from when I made my hello world), and I'm debating whether
or not I should buy the C++ standard document. So I have a couple
questions about it.
1. Under what circumstances would you recommend buying it? Is it useful
for mostly just compiler/library implementers, or do you guys use it in
everyday programming? If so, how?
2. There's a published version for about 60 USD (s...How to do analog input output of PCI-6052 or 6071 using simple C/C++ language
I need to drive a dc motor and read the potentiometer using the NI PCI-6052 or PCI-6071E by programming in simple C or C++ or Borland C but not in visual C.
what should be the necessary steps?
how to access the memory registers of NI Cards using C commands?
Adding to what Christian said here is a good link that should help you as well.
<a href="http://zone.ni.com/devzone/cda/tut/p/id/5409" target="_blank">
I found this by searching for "DAQmx text based" on...difference between Standard C++ 98 and Standard C++ 2003
does anyone know the difference between Standard C++ 98 and Standard
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:email@example.com ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Unofficial list of revisions, by Andrew Koenig:
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news...Why We Use C Than C++...
Hi, Please help me in this regard...
All the kernel level programs are written in C... (i.e: Open Source
LINUX)... Why are they not using C++... I personally feel that C++ is
more easy to code than C... When i searched in our encyclopedia (i.e
Google), i came up with several answers, telling "C is much faster than
C++ and most kernal prgms uses only C" ... But why is it so...? Why
they use C for these OS based programs.. Please Help me with detailed
In a well developed C++ program, there isn't much difference between C
and C++ perform...C++ code with C-style interface for a library to be used in C++ and C?
I have a question about building and then using libraries containing
Let's say I have some C++ code and a .cpp file with 1 function that
uses some other C++ code / classes etc... Also, any possible exception
is handled within the function itself.
extern int Test(float inParam1,float inParam2,float* outResult);
#endif // #ifndef MYMODULE_H
#include "MyClasses.h" // contains MyClassA and MyClassB
int Test(float inParam1,float inParam2,...What coding standard are you using for C?
What coding standard are you using for C (if any)?
Like naming variables, functions, constants, globals, locals, types etc.?
> What coding standard are you using for C (if any)?
> Like naming variables, functions, constants, globals, locals, types etc.?
> for example:
You will get as many *different* answers as respondent...the difference between standard c and standard c++ about their underlay realization mechanism
What is the difference between standard c and standard c++ about their
underlay realization mechanism?
I think it's hard to tell all the difference in detail,just me
some your opinion.
On 21 Nov 2004 06:52:59 -0800, firstname.lastname@example.org (zhou xiang) wrote
> What is the difference between standard c and standard c++ about their
> underlay realization mechanism?
The standards are available quite inexpensively from www.ansi.org in
PDF format. As for the realization mechanism, neither language
specifies one. They define an abstract machine that execu...C++ standards committee looking at adding Cairo to the C++ standard
It appears that Herb Sutter wants to add a 2D drawing library to the C++ standard, and he is
looking at libCairo as a base for this library.
The link to the Cairo's mailing list:
What are your thoughts on this?
Rui Maciel <email@example.com> wrote in
> It appears that Herb Sutter wants to add a 2D drawing library to the
> C++ standard, and he is looking at libCairo as a base for this
> The link to the Cairo'...how to use the return value when using C# dlls in a C++ project?
I am using a C# library in my C++ project. I want to make use of the
classes defined in the library to do some job, and use the return
value to go on other works in my project. But it seem difficult to
convert a return value of C# datatype into C++ complaint datatype,
like convert System::String in C# into std::string in C++.
like in my test code:
ClassA ^a = gcnew ClassA(); // ClassA is a class in the C# library
System::String result = a-> getResult();
std::string str; // here I want to copy result to str, then I can use
the string freely. But I don't know how to do it.
Is th...what should the minimum number of channels be on a DAQ board being used to acquire eight analogue signals (four using differental inputs and four using single-ended inputs)? and why?
I am sitting an exam and the lituture for this subject is a littel fuzzy. I think the answer is 13 analogue channels because the singel-ended inputs use a common ground so that makes 5 and then because the differential inputs each use there own groung referende thats 8. is this the correct answer and resoning?
Also sorry to be a pain but "what is the maximum frequency of these signals , which can be measured using a DAQ board with the maximum sampling rate of 500kHz?" I have no idea how to begain to work this out as ...Class B using Class C, and Class A using both B and C
The following code illustrates a problem I have been trying to get around in
c++. Can anyone explain how I can get this to work. The code compiles
fine if I leave out the lines with the comments after them.
Tnaks in advance for any help.
pair y= pair(2,4);
triple z = triple (1,2,3);
pair *x= new pair(1,2);
triple *fg= new triple (4,5,6);
...UNICODE input for CGI using C
I'm trying to accept a multi-lingual string (UNICODE) in a
form and am trying to parse it. What i am getting is %XX (which is a
single byte, not 2 bytes). So, is the data getting lost? What format
is it, if it is not getting lost.
Thanx in advance,
In article <firstname.lastname@example.org>,
> I'm trying to accept a multi-lingual string (UNICODE) in a
>form and am trying to parse it. What i am getting is %XX (which is a
>single byte, not 2 bytes). So, is the data g...Asynchronous programming using standard C
I'm interested in asynchronous programming but am having a few problems
understanding the underlying implementation.
I assume that asynchronous programming is generally done by calling a
function (which includes a call back function pointer in its arguments)
which starts a thread and then immediately returns. Once the thread has
completed the task it then calls the call back function to return the
data to the caller.
Is this the basic idea of asynchronous programming or have I got it
Thankfully threading is now on-topic in this group thanks to C11.
...Standard Library of useful utilities in C...
I'm new to c programming, and I come to it from higher-level, object
oriented languages. I was hoping to find a standard library that
contained common structures and functions that would be used in many C
programs. As an example, I am looking for a standard implementation of
a hash table.
Does such a library exist? I checked out the GNU C Library, but it
didn't seem to have what I was looking for.
Does every C programmer implement this stuff from scratch?
comp.lang.c.moderated - moderation address: email@example.com -- you must
have an appropr...Redirect standard input using CORBA
Hello, i need help or some advice to do some work.
I want to make a simple example, i've a Client and a Server.
My client ask the server to run some program, and i want that the server
return the output messages of the running program.
I want to know how redirect the output stream over CORBA. For now i've
created my client and my server. My client ask the server to run a program.
The server execute the program.
To launch the program on the server side, i've inherited from ACE_Process
and i'm using a ACE_Process_Options to set the command and parameters.
Tha...Using the carry flag in standard C
Recently the discussion about the integer flags started again.
I argued again with my "_carry()" function, but
Mr Jean Marc Bourguet and Mr K. Thompson proposed
a better alternative. Thinking about it, I think that their
solution is much better than mine, since it produces less
restrictions and fits better in the existing language.
We could do something like:
int add_with_carry(int a,int b, bool *carry);
int sub_with_borrow(int a,int b,bool *borrow);
int mult_with_carry(int a,int b,bool *carry);
The advantage of this is that in machines that do not have any carry
f...Issue with Using Standard input operation
I'm calling gnuplot from a script and the data is only ready
dynamically so I have to sent it to GnuPlot with the plot "-" operator.
If I do the following from the GnuPlot command line it works..
gnuplot> plot "-" with linesp
input data ('e' ends) > 1 2
input data ('e' ends) > 5 2
input data ('e' ends) > 6 3
input data ('e' ends) > 7 4
input data ('e' ends) > e
which produces a plot lines lines and crosses on the data points (i'm
excluding and extra settings for fitting data to scre...Use a wrapper to build a C++ Dll that calls a C++ .lib and Use the Dll is LabView
I need to access some functions in a C++ .lib within LabView, but has no source code for the library. Can I build a Dll in Visual C++ that calls this library, then have LabView calls the Dll? If so, how different is building this Dll compared to building a Dll from a .cpp file? I am new to C++, could some one suggest how to use the .lib in Visual C++ 6.0 studio to build the Dll?
Thanks for your help.
Thank you for the help. Sorry for the late reply here, got caught into a few busy projects. I do h...Anyone out there successfully using Pro*C/C++ in C++ mode?
So far I had been mostly satisfied with Pro*C/C++. It is a huge
improvement from by previous programming environment (OCI. I can't
believe I ever programmed in that assembly language). All my programs
have been written written in C so far. However, since I have been
known to get myself into trouble :-) I decided to try the C++ side of
Pro*C/C++, to take it for a spin.
Long story short: It was a bad decision, and I decided to go back to
good ole' C.
(1) That is not real C++. I use C++ for the convenience of 'string',
for instance, and the pre-compiler forces me to...Extent of standard C/C++ library support in Visual C++
I am curious whether or not Visual C++ fully supports standard C/C++
APIs. I have gathered the standard C/C++ APIs (mainly from
cplusplus.com) and posted that to the comp.sources.d newsgroup (too
long to be posted here). Can someone kindly scan through the list to
verify if everything standard is supported on Visual C++?
On Dec 28, 1:22 pm, songbg_...@yahoo.com wrote:
> I am curious whether or not Visual C++ fully supports standard C/C++
> APIs. I have gathered the standard C/C++ APIs (mainly from
> cplusplus.com) and posted that to ...C Standard as part of C++
To what extent is it necessary to have the C90 Standard, in addition to the
C++ Standard, to have the complete, official reference to the C++ language?
For example, I've noted that I can't find some C90 API function in the C++
Standard even though these functions are part of C++.
In what other ways is it necessary for one to have the C90 Standard?
Thanks to all,
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Dave Theese wrote:
> Hello group,
> To what extent is it ...