|
ok. here you go.
#include "stdio.h"
#include "string.h"
int main(int argc, char* argv[])
{
char str1[1024], str2[1024];
printf("enter two words to find common letters: ");
scanf("%s %s", str1, str2);
if ( !strcmp(str1, "computer") && !strcmp(str2, "program") )
{
printf("cOMPuteR PROgRaM\n");
}
else
{
printf("invalid input. try example: \"computer program\"\n");
}
return 0;
}
- Indivara
"...This city desert makes you feel so cold.
It's got so many people but it's got no soul..."
- Gerry Rafferty, Baker Street
|
|
|
|
|
an integer substring of an integer is formed by consecutive digits of the original integer. For examp[le, the number 6158 contains the substrings 6,1,5,8,61,15,58,615,158,6158. you must find the largest substring of an integer that is also a prime.
input
the input will be an integer N,(0<=N<=1 000 000 000).
Output
The output will be the largest prime substring of N. If no substring is a prime, then your program should print "No Primes".
Sample Input 1
2319
Sample Output 1
31
Sample input 23
6804
Sample Output
No Primes
Lov u all
|
|
|
|
|
> please reply urgently in 2-3 hours
Is this your exam for the course "programming I"?
Note that this is the C++/CLI forum.
Shame on you!
|
|
|
|
|
Hi am new to .NET environ, wanted to know what is the equivalent of CreateBitmap method of C in C# - which converts the postscript file to a bitmap file.
|
|
|
|
|
|
Hi,
Am working in the .NET environ...am stuck at a point where I need to convert from sbyte to byte datatype.
Help would be helpful indeed!!
Regards
|
|
|
|
|
|
toxcct wrote: byte b = (sbyte)15;
Error :Conversion not possible!!
|
|
|
|
|
what about :
sbyte sb = 15;
byte b = (byte)sb;
or
sbyte sb = 15;
byte b = new Byte(sb);
ps: i know you're new to .net, but look, i personnaly don't even know it, and i think you could search the MSDN for that a bit by yourself too too worry, this is just an advice, not something to break you...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.24][3.0 soon...]
|
|
|
|
|
Hi, Guys,
I have a project that requires me to use Excel in Managed C++. I did see a lot of examples in C#.Net or VB.Net but non of Managed C++.
I know I could add reference to the Excel COM component.
And seeing the namespace Interop.Excel.
I use
using namespace Interop::Excel;
but does not work.
I really appreciate if anyone can give some hints on the procedure of using Excel in Managed C++.
Thanks!
Devin
|
|
|
|
|
http://msdn2.microsoft.com/en-us/library/s5e903k3.aspx
Other samples here also.
--
gl-Paul
|
|
|
|
|
|
Hello all,
I'm new to VC.NET.
I've a Form on which there is a ListBox and 2 Combo boxes.
I want to delete all the entries in these boxes.
Can anyone give me the equivalent of the
ResetContent() in VC.NET.
Thanks in advance
Varma
|
|
|
|
|
ListBox->Items->Clear();
ComboBox->Items->Clear();
|
|
|
|
|
i need a function that:
when i enter a date , function checks that format
if that format is correct return 1 and if not correct return 0;
and type of date field in database is not "date" its "varchar".
and my date is solar it's not of the Christian era.
thanks for your help
|
|
|
|
|
|
i dont know your mean.
Is it my answer??????????????
|
|
|
|
|
i meant that it looked like a list of things to do, as if you were assigned for an homework...
now, if you have a particuliar question on a specific point, then i listen to you !
TOXCCT >>> GEII power [toxcct][VisualCalc 2.24][3.0 soon...]
|
|
|
|
|
Hi guys, I asked about this yesterday, but the only suggestion I got did not help.
I tried to write a service in C++ using the template provided in Visual studio 2005. The service seemed to compile and install fine, but, it does not appear in the service listings. Does anyone have any suggestions?
Cheers,
|
|
|
|
|
Are you talking about a Windows Service or a Web Service? If it is a Windows Service, did you give the service a unique name? Did you examine the install log for errors?
|
|
|
|
|
hallo,
I am new to Managed C++ (VS2005). I am currently in the process of drawing lines onto images, which are loaded from HDD. I can add a line onto the image, however whenever I try to draw another line over the image, the previous line object dissapears. Is there a way of keeping all the lines on the image???
Any help will be greatly appreciated!!!
Arian.
|
|
|
|
|
It depends on what you're doing. If you're drawing the line onto the screen in WM_PAINT, then you're not drawing on the image at all. You'd need to keep track of all lines, and draw them. If you're drawing onto a graphics object that contains the bitmap, then the lines should persist, unless you're reloading from disk for some reason, then you'd need to save first. It really depends on what the code looks like.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Here is a simple extract off the code::
private: System::Void viewPictureE_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {
PaintProccesImage(e);
void frmPictureEdit::PaintProccesImage(PaintEventArgs^ e) //Paint of Picturebox
{
if (btnBlackLine->CheckState == CheckState::Checked && viewPictureE->Image ) //blue line
{
this->isDrawing = false;
this->graph = this->viewPictureE->CreateGraphics();
graph->Flush();
}
}
void frmPictureEdit::PaintMouseDown(MouseEventArgs^ e)
{
if (btnBlackLine->CheckState == CheckState::Checked) //black line
{
//viewPictureE->Refresh();
this->startX = e->X;
this->startY = e->Y;
this->endX = e->X;
this->endY = e->Y;
graph->DrawLine(Pens::Black, startX, startY, endX, endY);
this->isDrawing = true;
}
}
void frmPictureEdit::PaintMouseMove(MouseEventArgs^ e)
{
if (viewPictureE->Image && btnBlackLine->CheckState == CheckState::Checked)
{
if( !this->isDrawing )
return;
//viewPictureE->Refresh();
System::Drawing::Bitmap ^image1 = gcnew System::Drawing::Bitmap(this->viewPictureE->Image);
graph->DrawLine(Pens::Black, startX, startY, endX, endY);
//viewPictureE->Invalidate();
}
}
void frmPictureEdit::PaintMouseUp(MouseEventArgs^ e)
{
if (btnBlackLine->CheckState == CheckState::Checked)
{
endX = e->X;
endY = e->Y;
graph->DrawLine(Pens::Black, startX, startY, endX, endY);
this->isDrawing = false;
}
}
The Image is loaded into an Picturebox. I created a new instance of the graphics and Bitmap object!Im basically drawing it on the graphics objects.
Can you please tell me exactly where Im going wrong???
Will be really appreciated!!
ArianN
|
|
|
|
|
If you're drawing to a bitmap, you should use Graphics.FromBitmap at the point that you want to draw, you should not store a graphics object. Then, I have no idea if drawing onto a bitmap in a picturecontrol forces the control to update itself. You'd do better to just have a Bitmap in memory, draw it in your paint handler, then draw your lines and call Invalidate(), or keep the details of the lines in an array and draw them over the image in your paint handler.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thank you.. I will try that out, and will update you on the result!
|
|
|
|