|
A lot of MMX functions, 128 bit math and the like are intrinsics in the Visual Studio compilers, they are enabled by linking with the MSVCRT runtime but you don't need it to use them. They're also not especially well documented, search MSDN for intrinsics and keep digging.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
I should have phrased my question better - what I meant was are functions such as strstr optimized for MMX?
Having searched a bit more Intel provide a library Intel Performance Primitives which may offer some hope.
modified on Tuesday, March 4, 2008 5:43 AM
|
|
|
|
|
Yes, if you want optimised standard functions that use the newer instruction, Intel libraries built with Intel's optimizing compiler backend is definitely the way to go. GNU glibc has some of the lower level i386 support functions e.g. memset written in hand optimised, GAS format, assembler but the Intel tools will optimise your whole code, post compilation.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
dear all
i am doing image processing, when i would like to convert RGB to grayscale, Y = 0.3*R + 0.59*G + 0.11*B, the error occurred below:
error C2440: '=' : cannot convert from 'unsigned int' to 'unsigned int *'?
anyone help me? thanks
Li Zhiyuan
|
|
|
|
|
The message is descriptive enough: you're trying to assign an integer to a pointer. Please post Y, R, G, B declarations for further help.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
You are trying to convert from a pointer to integer to an integer. And the conversion is not possible.
The error message was quite clear enough, don't you think ?
|
|
|
|
|
li zhiyuan wrote: Y = 0.3*R + 0.59*G + 0.11*B, the error occurred below:
error C2440: '=' : cannot convert from 'unsigned int' to 'unsigned int *'?
change to,
*Y = 0.3*R + 0.59*G + 0.11*B;
|
|
|
|
|
thanks friend
how to convert RGB image to grayscale and let RGB value become one value, for example, [(r,g,b),(r,g,b)]to [a,b], thanks a lot, however i tried, but can't, sorry in this area i am so weak.
Li Zhiyuan
|
|
|
|
|
you tried something and end up with error, if you can post your code, i will try to direct.
|
|
|
|
|
Hi all,
Actually i want to know that what api is used for getting installation path of currently running exe....
Thanks in advance....
|
|
|
|
|
GetModuleFileName [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
hi everyone,
i am learning vc++.so i am getting some problems. please help me.
For ctr = 0 To 15
dout(ctr) = Asc(" ")
Next
For ctr = 0 To Len(strData) - 1
dout(ctr) = Asc(Mid(strData, ctr + 1, 1))
Next
this code is in VB but i am working in VC++ so i am not getting the equivalent functions please help me if anybody know. its my kind request.
thanku in advance.
savitri
savitri s p
|
|
|
|
|
What if people here don't know VB? Try to explain your problem, rather than putting up some alien code here.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
for (ctr=0; ctr <=15; ctr++)
{
dout[ctr]=' ';
}
for (ctr=0; ctr <strlen(strData); ctr++)
{
dout[ctr] = strData[ctr+1];
}
Provided dout and strData are character arrays (but if they are really character arrays, you probably don't need the above code ).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Why are you encouraging that person? I'm afraid this will be come a habit and the OP will come here with VB code on a daily basis. You must answer all of that, as a punishment.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
If he need to translate some VB code to C++ then what would be the right forum?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
What if the VB thing consists 1000+ lines and contains so many GOTO and ON ERROR RESUME NEXT thingies? Okay. My opinion was that the OP could have stated the problem, because she wants to learn Visual C++. Posting some VB code and asking for its Visual C++ equivalent would not teach her anything. Agree?
Also, we don't have a VB to C++ forum. The idea looks dirty to me.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
It also could be a scam too do a school task. Write your task in a pseudo programming language, like that VB thing you're talking about. And then ask us to provide a real program.
codito ergo sum
|
|
|
|
|
BadKarma wrote: It also could be a scam too do a school task. Write your task in a pseudo programming language, like that VB thing you're talking about. And then ask us to provide a real program.
That's funny. Thanks for the humor.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: What if the VB thing consists 1000+ lines and contains so many GOTO and ON ERROR RESUME NEXT thingies?
We can give some hints and help her (since you know savitri is a female name, I'm not able to guess it for sure) to go on C++ and more on the OOP way.
Rajesh R Subramanian wrote: Posting some VB code and asking for its Visual C++ equivalent would not teach her anything. Agree?
Maybe someone catches that wrong question and handle it to show the right way.
Rajesh R Subramanian wrote: Also, we don't have a VB to C++ forum. The idea looks dirty to me.
Translating VB to C++ is not dirty at all. You may think the opposite, but there are a few VB skilled developers around (and there are, as well ugly C++ coders...). IMHO attacking VB without strings is only the last childish trend.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I think regardless of the no. of lines of the VB program, if the OP really wants to learn C++, then she must state her problem precisely, just like how everyone else does here. Just my opinion.
CPallini wrote: Maybe someone catches that wrong question and handle it to show the right way.
I'll agree on that.
CPallini wrote: Translating VB to C++ is not dirty at all. You may think the opposite, but there are a few VB skilled developers around (and there are, as well ugly C++ coders...). IMHO attacking VB without strings is only the last childish trend.
You got me wrong here. I was emphasizing on the fact that we must encourage people from learning the new language the proper way, instead of providing them some kind of a "translation service", which may make them get used to this service.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: What if the VB thing consists 1000+ lines and contains so many GOTO and ON ERROR RESUME NEXT thingies?
Then you ignore the post and move on. A comment to every post, contrary to popular opinion, is not necessary.
Rajesh R Subramanian wrote: My opinion was that the OP could have stated the problem, because she wants to learn Visual C++.
The problem was stated with code. That's good enough for, and easily understood by, most.
Rajesh R Subramanian wrote: Posting some VB code and asking for its Visual C++ equivalent would not teach her anything. Agree?
No, not at all. But then everyone has a right to their own viewpoint. Some folks are capable of learning a great deal by mapping what they know to a new language.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: Some folks are capable of learning a great deal by mapping what they know and are comfortable with to a new language.
I missed that. Thanks for pointing out.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
CPallini wrote: If he need to translate some VB code to C++ then what would be the right forum?
Coding Horrors[^]
|
|
|
|
|
I spurted out tea man. That's it. I need to read CP or drink tea. I can't mix them both.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|