|
Hi there,
I have learned the principles of OOP and implementations in both java and C++ either on my own or in my school courses but we only grazed it. At this point, I feel very uncomfortable with OOP and I need a good resource that will provide me with a great deal of problems that require OOP to solve (or are best solved using object oriented approaches), and their respective answers with clean code and good practices. I have had very very little practice with OOP and want to practice as much as possible to get comfortable with it. I have been searching a lot but I can't seem to find a good resource.
Optimally, I would like it to begin with very trivial questions and progressively become more and more difficult.
Thank you.
|
|
|
|
|
|
|
4india wrote: I think you can refer this refer this site for knowledge buildup. I think not; the first example I looked at is wrong.
|
|
|
|
|
He's just spamming - why would he care if it works?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Correct, more votes still needed.
|
|
|
|
|
Hi,
I want to generate a dump file automatically whenever the application crashed/hanged. Is there any option to do it or how to do it programatically as the developer don't know when that application crashes at client location.
Thanks in advance for your help.
|
|
|
|
|
AFAIK Dump Files are managed by the OS - whichever it is - so you should look on the OS documentation. It is probable that you need to instruct the OS that you want a dump file and of which kind you desire (short, long, kernel...).
For example see if
http://msdn.microsoft.com/en-us/library/d5zhxt22.aspx[^]
is of any use for you.
HTH
|
|
|
|
|
Hi,
Thanks for your reply.
|
|
|
|
|
You can tell windows to create these dmp's for you (starting from Windows Server 2008 and Windows Vista SP1).
See MSDN for details: Collecting User-Mode Dumps[^]
|
|
|
|
|
Hi,
Thanks for the reply.
|
|
|
|
|
Hi all,
I have to get the infomation from USB by C program.
Could you give me the ideas or C code??
Thanks all
|
|
|
|
|
Not unless you're just trying to access a file that's on a flash drive.
|
|
|
|
|
|
hello guys,
i have to write a simple project ... it is a hangman code in C#
i have this...but when I run it... i keeps printing twice some sentences... if anybody can help me... and if the user type something different from l ..when it is asked...everything goes wrong...
#include <stdio.h>
#include <string.h>
#define NUM_TRIES_ALLOWED 10
main()
{
int num_letters = 0,
count = 0,
tries = 0,
num_vis_chars = 0,
correct_guesses = 0,
correct_flag = 0,
repeat_flag = 0,
choice;
char guess,guessword;
char word[255] = " ";
char incorrect_letters[255] = " ";
puts( "Enter a word for player to guess." );
gets( word );
printf("Ready to start!\n");
num_letters = strlen( word );
char visible_word[num_letters];
for( count = 0; count < num_letters; count++ )
visible_word[count] = '*';
visible_word[num_letters] = '\0';
if (guess == visible_word[count]){
while( tries < NUM_TRIES_ALLOWED )
{
printf( "The word is: %s\n\n", visible_word );
printf("Number of turns remaining: %d", NUM_TRIES_ALLOWED-tries);
printf("\nWould you like to guess the word [w] or guess a letter [l]:");
choice = getchar();
if (choice=='l'){
printf( "\nWhat letter have you chosen?:\t " );
scanf( " %c", &guess );}
for( count = 0; count < num_letters; count++ )
if( guess == visible_word[count] || guess == incorrect_letters[count] )
{
repeat_flag = 1;
correct_flag = 1;
break;
}
if( repeat_flag == 0 )
for( count = 0; count < num_letters; count++ )
{
if( guess == word[count] )
{
visible_word[count] = guess;
correct_guesses++;
printf("\n**************************************************************\n\n");
printf("Good choice!\n\n");
if( correct_guesses == num_letters )
{
puts( "\n\nCONGRATULATIONS! You guessed the word!" );
printf( "WORD: %s\n\n", visible_word );
exit( 0 );
}
correct_flag = 1;
}
}
if( correct_flag == 0 )
{
incorrect_letters[tries] = guess;
tries++;
printf("\n**************************************************************\n\n");
printf("Bad choice!\n\n");
}
repeat_flag = 0;
correct_flag = 0;
}
puts( "You did not guess the word." );
printf( "WORD: %s\n\n", visible_word );
}
if (choice='w'){
printf( "\nWhat word have you chosen?:\t " );
scanf( "%s", &guessword );
if(guessword==word){
printf("CONGRATULATIONS! You guessed the word!");}
else{ printf("nops");
}
}
return 0;
}
|
|
|
|
|
Try using your debugger to identify exactly where the problem(s) occur.
|
|
|
|
|
my debugger screen is grey, I tried to do this....but I couldnt
|
|
|
|
|
I cannot even get your code to compile so I have no idea how you are managing to run it.
|
|
|
|
|
My up-vote for trying.
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
|
|
|
|
|
A quick desk check suggested a number of errors, but I wanted to be sure. 
|
|
|
|
|
Member 11189395 wrote: i have to write a simple project ... it is a hangman code in C# If this is true, then you should be in the C# forum. Otherwise, what you have shown looks like C code.
Member 11189395 wrote: i have this...but when I run it... i keeps printing twice some sentences... Have you stepped through the code using the debugger? Are you using Visual Studio, or some other IDE?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
We have some old code which creates an XML document tree, using IXMLDocument and related interfaces. Anyway, some code creates a text node and we pass in text such as "5.0 £" or "2.5 €". The currency characters are non ASCII and are not valid in an XMl text node. For example this is invalid:
<cost>2.5 €
It needs to be translated as follows:
<cost>2.5 &#euro;
I can process the string e.g. "2.5 €" replacing each non ASCII character with a numeric character reference, and then create the XML text node. Is there a better way to convert the CString content to XML compliant text? I cannot find anything in Microsoft code. (As far as I can see Xerces would handle this but we do not use Xerces.)
|
|
|
|
|
Let me explain, as precisely as possible, my expectation : I have 3 physical drives (200 GiB, 300 GiB, 500 GiB), but number and size of drives may vary. By using an unique Virtual Drive (VD) seen by an user, the goal is to allow standard file operation (copy, delete, move) through Windows file explorer or a Windows console on this VD. Final user will always see an unique drive letter.
For instance, the added value of my idea is to put on 1st drive some movies and to duplicate them on 3rd drive. Once the 1st drive is full, my soft will copy the next movies on 2nd drive while continuing duplicate it on 3rd drive. Of course, 1st and 2nd drive are marked as "1st virtual disk" and 3rd is marked as "duplicated" by manual configuration (with HMI showing physical drives for instance but it's my problem)
I don't want to hear about ANY RAID which have inconvinient to be "unreadable" once 1 disk is removed. RAID should mandatory have same disk size in order to do "mirror" feature. The added value of my idea is the ability to read any hard drive anywhere without any filesystem constraint. It's a fine way to recycle my old hard drives.
My question is how to create such a VD and how to intercept file operation on this VD and how to show (on this VD customized) customized FAT contents (contents of 1st and 2nd physical drives) by using Visual Studio.
Many thanks in advance.
|
|
|
|
|
|
how to write the c program to display ' Hello world ' without using semicolon ?
|
|
|
|