|
If you tell me the email of your teacher, I'll forward your question there.
|
|
|
|
|
hi everyone
can n e one send me a simple code of creating a server (creating socket, binding, listening, accepting connection ). i need the statements that do it. it wouldn't be hard for guys around here. Code should be in VC .NET
thanx in advance.
Rashid
|
|
|
|
|
When a user types in a sentance, and i want to seperate each word, how do i do i do that. I need to get each word seperatly.
|
|
|
|
|
Frustration!
I am trying to assign the value of a character array ( of type char my_array[99];) to a combo box but am just getting cryptic messages about boxing and __gc / __value.
I know that this should be very simple, I have found many examples using comboBox1->Items->Add(S"some text") but cannot seem to get it to use the contents of my variables
I am using Visual C++ .net
Please help, not much hair left!
-- This is a re-posting, Incorectly posted on the C++ board
|
|
|
|
|
This is really, like you guessed, a simple thing.
You're using Visual C++ .NET, probably to compile a Managed Application, and you've declared a simple char [] array to use with .NET objects and methods.
We all make a similar mistake when first writing a managed app: the char [] is a user-defined type. It is not a CLR type. This means that your char [] is an unmanaged type, and as a consequence, all .NET (I'm oversimplifying here) types and their methods will find this type incompatible, and the compiler will produce error messages.
The cryptic __gc message just tells you to use the "__gc" keyword (this is a Microsoft-specific language keyword) that indicates that the type following is a managed type (garbage collected).
Read this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmxspec/html/vcManagedExtensionsSpec_4_5.asp[^]
You might find this CodeProject article even more helpful:
http://www.codeproject.com/managedcpp/csarrays01.asp[^]
|
|
|
|
|
Thanks for this (I think!)
I have 'hacked' a work around.
I have used an invisible text box
Added my array contents to this
Then used the contents of the text box
I think this is very messy but at least it works
If anyone is interested I will post the work around
Merry Christmas
|
|
|
|
|
Please can some tell me what are the header files required to write a basic C++ and Oracle programme. A sample code would help a lot.
Every is Illusion
|
|
|
|
|
What does this have to do with MC++ ?
There are no headers, you just need a driver for Oracle and ADO.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Anyone know how I would do this? I would think it's something like...
<br />
int myNum = 7424;<br />
String * myNumAsHex = Convert::ToString(myNum, "X");<br />
That doesn't work of course because I think you need to use the IFormatProvider class but I can't seem to use it correctly, any ideas?
|
|
|
|
|
I think you can finish it as the following:
int nNum = 7424;
char szNum[20];
sprintf(szNum, "%x", nNum);
Coding,I love it! MM,I Love it 2!!
|
|
|
|
|
itoa() with radix parameter set 16 will convert to HEX string
See details of itoa()
|
|
|
|
|
Thanks for your suggestions, is there a way to use the .NET framework to do this? Or must I use native code?
|
|
|
|
|
are you sure, you CANT do it , the way you mentioned??
I did something like
byte b = 44;
string str = b.TosTring("X");
and it worked....
|
|
|
|
|
I figured it out, you need to use the Int32 class, AFAIK byte is a value type in MC++ so it couln't have the ToString associated with it.
So it's
<br />
Int32 test = 5432;<br />
String * testStr = test.ToString("X");<br />
|
|
|
|
|
What? Value types derive from System.ValueType which in turn derives from System.Object, so they do have ToString() defined.
Regards
Senthil
|
|
|
|
|
C++/CLI will give C++ programmers first-class access to the CLI platform. Standardizing C++/CLI ensure that the code written by C++ programmers will be portable across the tools offered by multiple vendors.
http://www.orkut.com/Community.aspx?cmm=921513
|
|
|
|
|
Hi fellow developers,
I am new to C++.Net. I move my VC6 projects to C++.Net and one of the project behave a little bit strange. When I invoke the Add Member Variable Wizard for a control in a dialog box, the Control ID is blank and disabled. I suspect some setting has caused this to happened.
Does anybody have any information to fix this problem ?
Thanks for any information.
|
|
|
|
|
Hello,
I'm request some help. See subject.
-=Munchausen=-
http://www.geocities.com/madhousebbs (mostly hungarian, sorry)
|
|
|
|
|
Could someone please give me and example of RegDeleteKey
|
|
|
|
|
|
OK guys well im sorta finished with my final project but i cant get it to work CORRECTLY. The program is to have a menu and ask the user to choose betweetn add, subtract, mult and divide. when they choose whatever one it will ask them a simple question. and if they get the correct answer or wrong answer it will ask them again if they want another problem. If they choose yes then it will give em another problem but if they choose no it will go back to the menu. I cant seem when they enter no it keeps say "enter another seed vaule" I want it to go back to the menu. Well here is the code. O and if they enter anything besides Y or N i need it to say sorry that is an incorrect choice. Here is the code:
#include <iostream>
#include <iomanip>
#include <cstdlib>
using namespace std;
int main()
{
int choice; float num1, num2, answer, correct;
char again;
unsigned seed;
do
{
cout << "\n\t\tSimple Math Tutor Menu\n\n";
cout << "1. Addition\n";
cout << "2. Subtraction\n";
cout << "3. Division\n";
cout << "4. Multiplication\n";
cout << "5. Quit The Program\n\n";
cout << "Please enter a choice: ";
cin >> choice;
if (choice <1 || choice >5)
{
cout << "Sorry that is an incorrect choice!"<<endl;
cout="" <<="" "please="" enter="" another="" choice="" "<<endl;
="" cin="">> choice;
}
cout<<"Enter a seed value: ";
cin>>seed;
srand(seed);
num1 = 1 + rand() % 10;
num2 = 1 + rand() % 10;
switch (choice)
{
case 1 : do
{
cout << "What is the sum of "<< num1 << " and " << num2 <<endl;
cin="">> answer;
correct = num1 + num2;
if ( answer == correct)
{
cout << "Congratulations you are correct!" <<endl;
}
="" else
="" {=""
="" cout="" <<="" "sorry="" that="" was="" incorrect"="" <<endl;
="" "the="" correct="" answer="" was:="" "="" "would="" you="" like="" to="" do="" another="" problem="" (y="" n)?="" ";
="" cin="">> again;
cout<<"\nEnter another seed value: ";
cin>>seed;
num1 = 1 + rand() % 10;
num2 = 1 + rand() % 10;
}while (again=='y' || again=='Y');
if (again != 'y' || again !='Y')
cout << "Sorry That is an incorrect choice" <
|
|
|
|
|
Just an FYI,
You might want to post in the forums for C++, this is Managed C++, which is code written to run on the .NET Framework.
Eventhough, you could comile with the /clr flag and run native C++ in the CLR, but the point is post in the right forum for better respones.
R.Bischoff
Tengas un buen dia
|
|
|
|
|
Here is the section out of my program that I am having problems with.
char first[20];
ifstream
fin;
openfile(fin);
char str[20];
char* trun;
char* trun2;
char *seps = "\0";
while (!fin.eof())
{fin.getline(str, 30, '\n');
fin.ignore(1);
cout<<str<<endl;
trun = strtok (str,seps);
cout<<"---"<<trun<<"---\n";
if (!doRetrieveVertex (graph, trun))
{doInsertVertex (graph, trun);}
strcpy(first, trun);
while (trun2 != NULL)
{ cout<<trun2;
trun2 = strtok (NULL, seps); \\Here
if (!doRetrieveVertex (graph, trun2))
doInsertVertex (graph, trun2);
cout<<"Internal while";
}
cout<<"External while";
}
If I comment out where it says "trun2 = strtok (NULL, seps);" Then it will run but it stays in an infinite loop inside that Internal while loop. But if I do not then I get a core dump. Please help me if you can it is due tomorrow. Thanks
James
|
|
|
|
|
1 2 50 3 70 4 23
2 1 50 3 34 4 75
3 1 70 2 34 4 80
4 1 23 2 75 3 80
Here is some sample data that we created and also I changed where seps is to " " so that it will break it into pieces. Basically what it is doing is getting the first line and then breaking off th efirst piece and retaining that and then breaking the others off and adding those. We are making a graph if you are wondering.
|
|
|
|
|
You can use your ifstream to read consecituve ints from your file directly without messing with this C ugliness.
And you asked in the wrong forum, this has nothing to do with MC++
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|