|
J_E_D_I wrote: cout << NUMstringa; doesn't display anything! It doesn't acutally compile because it shows an error.
Nice to see , that finally, you solved your problem.
But, some advice, while using forums.
Always, be very specifice while stating the problem. If, you had mentioned this (compiler error) line initially, that would have definitely saved some posts. .
Prasad
MS MVP - VC++
|
|
|
|
|
Hi,
Can any one give me some information on how to optimize performance while using both managed and unmanaged C++ calls in C++ /CLI
Regards
Sabarish
|
|
|
|
|
help me to know about the some of the keywords in C language they r
REGISTER,STATIC,UNION,SIGN AND UNSIGN
pls take out some time and try to give me with examples.
|
|
|
|
|
Let’s see:
1) auto -> modifier automatic (ignore)
2) break -> break out of loop or ‘switch – case’ construct
3) case -> part of ‘switch –case’ construct
4) char -> a signed single byte (8-bits) character (normally)
5) const -> a promise that you are not going to change the value of a variable
6) continue –> goto start of loop
7) default –> default case in ‘switch – case’ construct
8) do –> start of ‘do-while loop’ construct
9) double –> double precision numeric value
10) else –> ‘if – then – else’ construct
11) enum -> a grouping of int sized named constants
12) extern -> declaration of a named item is in external file (normally ignored)
13) for -> start of for loop ( for( i=0; i<n; ++i)="" do="" something="" )
14)="" goto="" -=""> goto named label (rarely used and only if absolutely required)
15) if -> test if true ( if( f != 0 ) do something )
16) int -> whole numeric value (no decimal point) (size of machine word in theory)
17) long -> whole numeric value (size ?)
18) register -> suggestion to compiler to place variable in register (normally ignored)
19) return -> return variable to calling function
20) short -> 16-bit integer (int) variable
21) signed -> (modifier) sign matters +/- (ignored, because it is default behavior)
22) sizeof -> size of variable (in C++ size of object, which is not the same thing)
23) static -> life time (exist in permanent memory)
24) struct -> a grouping of values or a record.
25) switch -> start of ‘switch – case’ construct
26) typedef -> method for giving a user defined type a name
27) union -> method of combining types (rarely used)
28) unsigned -> (modifier) all values are positive ( unsigned int )
29) void -> no return value, or no argument
30) volatile -> you can change value any time (stupid – ignore – default behavior)
31) while -> start of ‘while loop’, end of ‘do while loop’
Hmmm! I think that is all but I thought there where 32 keywords. Any way there are still 14 preprocessor keywords.
Oh – by the way, the keywords are case sensitive.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
thanks a lot for responding for my queries.
regards
rani
|
|
|
|
|
Remember to keep in mind that some keywords act differently in C++.
<br />
char temp[10]; <br />
<br />
sizeof(temp) -> is size of pointer in C – currently that is 4 bytes<br />
sizeof(temp) -> is size of object in C++ - which is 10 characters<br />
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
|
I'm glad you got your answer, but please don't post C questions in the C++/CLI forum in future.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
tell me about void in c language
|
|
|
|
|
you should be more specific.
Generally, void is used in functions.
1)If the function does not return any value,ex:
<br />
void Print_Numbers (int i)<br />
{<br />
for (i;i<100;i++)<br />
cout<<i;<br />
}<br />
When you call the above function, you should send an integer parameter,say n, and the function will print the values from n to 1000. No return type is needed, that is, void will be set as a return value.
2)You can have the parameter also to be void instead of (i). In this case you should initialize the variable i inside the function.
I hope this is what are you looking for,
|
|
|
|
|
thanks for ur response....
but i need significance of "void"
|
|
|
|
|
|
Void: The total absents of anything.
1) If void it the return type, then the function returns nothing.
2) If void is an argument to a function, then the function takes no arguments.
3) If you convert a pointer to a variable to a pointer to void, it means that only you (normally) know what type it origanaly was. Very handy for passing around indirect references (pointers) to types, but dangrous if the reciever converts it to a variable type other than the original type. By the way most modern operating systems depend on this ability, because message passing requires the ability to pass references (actually indirect references) around.
It is that simple.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
could anyone help me with the projrct on streamline allocation i.e i need a complete coding for this project.actually in this C++ program i have to allocate marks to students on the basis of their performance in exams
|
|
|
|
|
Are you using C++ or C++/CLI?
and please be more specific in your question.
show us what have you done so far and what problems did you encounter to be able to help you.
|
|
|
|
|
Hello ,
I have three forms and i want to be able to go to the previous form, from forms 2 and 3 can anyone help me with the codes ?
Form2 is called from Form1 and Form3 is called from Form2
debun
|
|
|
|
|
In Form2, call
<br />
Form1->Show(); <br />
do the same with Form3.
P.S: you are in the wrong forum. your question should be asked in the Windows Forms forum.
|
|
|
|
|
I guess I'm going to have to hammer on the message boards until I get this straight in my head. I guess I don't think Germanic enough (throw the cow, over the fence, some hay). This is just as hard as when I was learning MFC, nothing seems to work the way you think it would (or the way you want it to). MFC had edit controls that allowed you to link a variable to the control whether the variable was an int, float, CSting, etc. But there does not seem to be a equivalent control in C++/CLI. Am I supposed to use a textBox control and then convert the string to a numeric? If so, how do you do this conversion? In other words, I have a dialog based application that I want to place a dozen fields on it for the user to enter information. Some of the information will be integers, some will be floating point, and some will be text. What controls would I use to accomplish this?
Thanks
Buck
|
|
|
|
|
I'll leave the Forms stuff to the experts (I still use MFC for UI )...
BuckBrown wrote: use a textBox control and then convert the string to a numeric? If so, how do you do this conversion?
The Sytem::Convert class can do these conversions:
try
{
int textboxint = System::Convert::ToInt32(MyTextBox->Text);
double textboxdouble = System::Convert::ToDouble(MyTextBox->Text);
}
catch (System::OverflowException*)
{
System::Console::WriteLine("Numeric Overflow");
}
catch (System::FormatException*)
{
System::Console::WriteLine("Bad string format");
}
catch (System::ArgumentException*)
{
System::Console::WriteLine("NULL String");
}
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Thanks Mark,
Works good. I have 3 books on begining C++/CLI programming and none of them mention the System::Convert. It's hard to find information on Microsoft's website too (probably because there is just tooooooo much information there. Oh how I miss the days when all you needed was a function reference manual and you just looked in the index. Even if I google 'CLI convert' I can't find any reference to it. If you know of any COMPREHENSIVE books the you could recommend that would be cool. And any book that is basically a C++/CLI function reference manual for the meat and potatoes stuff would be great.
Buck
|
|
|
|
|
I'm still a rookie with .NET. I have a huge base of MFC/Win32 code which only in the last year or
two I've started mixing managed code in places where the .NET classes are easier to use than
straight APIs - XML, WMI, and .NET Remoting (SWEET interprocess communication) come to mind
immediately.
Learning the C++/CLI language stuff - the new C++ enhancements for managed code and mixing
managed and unmanaged code (interop) - was not a huge deal. Easy enough for mixed-mode coding
(although I didn't trust the GC at first ).
But the .NET framework is HUGE. So many namespaces with so many classes - it's growing faster
than I can keep up. I've barely touched any of it. I'm pretty sure the framework has wrapped
everything I've ever done Windows programming, but I still don't know how to find everything
easily.
The .NET SDK is still my most-used source of info. That, and bookmarking any classes or info I
see go by on these boards that I think will be useful in the near future.
I'm curious what's in Nish's new book on C++/CLI!
I'll definitely post here if I run across what I feel is a useful book/resource.
Cheers,
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
BuckBrown wrote: Even if I google 'CLI convert' I can't find any reference to it.
Hi Buck, first when searching for things in the .NET Framework Library there is nothing specific to CLI. CLI is basically a C++ extension for using C++ to develop managed code. Therefore don't use CLI as a key word but instead use 'C#'. Also preface the key words with 'MSDN'. So in the case of your query the search phrase would be:
<br />
MSDN C# Convert string to double
Google Results[^]
led mike
|
|
|
|
|
*hijack* Thanks for the tips led mike! I already use "MSDN2" in my searches but I never thought
to use C#.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I am getting my feet wet in Visual Studio 2005 and C++/CLI. I have a ListView that I can sort on each column but I would like to add the sort direction arrows in the column headers and can't seem to find much information on how to do this. Any info at this stage would be helpful.
Thanks
Buck
|
|
|
|
|