What is C#??? and .NET help me

vidiware

Freshman
Joined
Dec 3, 2002
Messages
39
What exactly is C#???? A c++ lite? with basic elements?

In visual studio you have the possibility to make programs wiithout the form in visual basic, whats now the difference between vc++ and vb when you remove the visual thing?

Im really fustrated...
Quite newbie programmer, who want to program in DX (7-9)
and want to learn c++ at the same time...

Can you please recommand me something
 
You're really best off reading about the differences on the Microsoft website. There isn't a great deal of difference between VB.NET and C# besides their syntax. None that's likely to matter to you anyway.
 
I'd recommend any DirectX for beginner book. They're all for C++ except two or three (for Visual Basic). Coming out in a few months will be books on DirectX9, but none have been released yet.

If you don't know C++, I'd recommend a book that teaches the basics of programming C++ first, before the DirectX book. There used to be free, full versions of older books including some on C++ at informit.com. If not, your local library will have C++ books you can check out for free.

If you want to dive right in, head over to http://www.gamedev.net and click their "Articles and Resources" link at the top. For information on different languages libraries (DirectX vs. OpenGL) and more, click the "For Beginners" link at the top.

-Nerseus
 
It depends on what you want to do in DirectX, really. I'd hope you'd know the standard structures (if, while, switch, etc.), how to declare and use variables, etc. That's a pre-requisite to be sure.

After that, it really depends on what you want. If you have a good DirectX book, it will come with source code ready to go. If not, you're in a heap of trouble - you'll have to figure out how to add include directories, header files, and more just to get something started. I'd recommend a book with a CD of source code :)

Once you get a sample or two working, you'll really want to know a LOT more about C++ before you'll want to know about DirectX. Most books try to encapsulate DirectX into custom "wrappers", which the Author will show you. Unfortunately, if you don't know C++ very well, classes will be mostly confusing if you haven't used them before in another language.

The bottom line is that you'll want to know C++ well enough to write a simple, non-DirectX app before you begin writting a DirectX app. Give yourself a little task and see if you can write a program to do. I did the following when I first started programming on my friend's Vic-20:
1. Generate a random number between 1 and 100.
2. Ask the user to enter a number between 1 and 100
3. Tell them "higher", "lower" or "You got it"
Once you get it working, see if you can move some of the code into functions, to see how to pass parameters back and forth. The point is to try and learn some of the basic of C++. After that, pick up a DirectX book and start learning! :)

-nerseus
 
I have made a program like that in quick basic...
In c++ consolemode i will start now!
But in winows mode im sorry doesn't have a chance
 
lol - well, you can get free books online as well. Head over to informit.com to get a few books free (online) for C++ v.6, VB6, and even C#!

Good Luck!

-Nerseus
 
Online -Yes... but as afar as i saw, not free...

Do you have any good books in easy english? Any recommadations... Im going to the bookstore soon
 
There are authors of C/C++ books that aren't native english speakers themselves. I can't speak for other books, but I strongly recommend you check out Beginning Visual C++ 6 by Ivor Horton. Includes just about everything a beginner could want to know in one book, towards the end he even starts working with MFC and databases.

Here's a link for more information: http://www.amazon.com/exec/obidos/tg/detail/-/186100088X/103-5540681-5793406?vi=glance

But yes, you are better off learning the language first then learning DirectX (learning DirectX can sometimes be just as difficult as learning C/C++). There really is no simple and easy way to learn C/C++, it's going to take a lot of patience and dedication but believe me (and everybody else here), in the end it's worth it.

If you try to learn both C/C++ and DirectX at the same time you're going to have many nights staying up late with headaches. :)
 
in c++ i cant write:

// Randomizer.cpp : Defines the entry point for the console application.

#include <iostream>
#include <stdlib.h>

int main(int argc, char* argv[])
{
//Here are the problem
cout << "Hi, welcome to VidiWare Randomizer Game!/n";

return 0;
}

I have to put up std::cout ...

Whats wrong... I did call STDLIB.H...


-------------------------------------------------------------
And is there a way to pause the application under debugging?
If it ends on output you can't see it
 
Last edited:
I think you need something like:
using namespace std;
or just:
using std;

(I forget) :)

Also, only some of the books on informit.com are free (24 I think). Look in the Free Library section, it doesn't have a direct link from the main page but here's how to get to it:
1. From the home page, click on the "+" sign next to Programming on the left.
2. On the next page, on the bottom right under "In the Free Library" click on "More Programming Free Library Books".
3. At the top of the page next to "Browse the Free Library" you'll see: Home > Free Library > Programming. Just click on Free Library and bookmark that page! :)

I'd give you my link, but it has my sessionID which won't do you any good. :)

-Nerseus
 
Well its finnished!
My Randomizer Project...
Im releasing it under General Public Licence...
Happy using of it....

And can you see if that was a nice way to complete my "Newbie" mission?

You need to compilet it with MS Visual Studio .NEt or at least C++ .NET.
I dont hope you need that framework thing installed!!!!
:D
And maybe you can compile it with any C++ Compiler!!!:rolleyes:

Please tell me what you think!!!
 

Attachments

Last edited by a moderator:
lol, I love "type in something and press Enter to Quit" :)

I found a a few problems, but whether you want to change them or not is up to you. On a larger project you'll want to make sure you *thoroughly* test each piece of code before moving on. For instance, you can enter letters instead of numbers and cause an infinite error loop. Also, your attempts variable is off by one (it says 0 attempts after my first guess).

But not too bad overall - I'd really get rid of the goto if you can (and you can). I'd also suggest trying to break some of the code into functions. For instance, create a function CreateRandomNumber() that returns a new random number. Once that works, try CreateRandomNumber(number) that takes a parameter of type int and sets its value. Similar to a ByRef argument in VB. Just to make sure you understand the basics of pointers in C++.

After all that, see if you can create a simple "player" class to contain the number of guesses, last guess, etc. to help you understand the usage of classes, instantiating them, etc.

Obviously all this is overkill for such a simple game - but it will help you get down the basics of the language so that you won't have to pause in the middle of learning DirectX (or any other add-on technology for that matter) simply to figure out the basic.

And most importantly, Have fun!!
-Nerseus
 
Nerseus said:
lol, I love "type in something and press Enter to Quit" :)

I found a a few problems, but whether you want to change them or not is up to you. On a larger project you'll want to make sure you *thoroughly* test each piece of code before moving on. For instance, you can enter letters instead of numbers and cause an infinite error loop.


Any Suggestions to not permit ppl type in letterS?

And i must admit im quite unsure at how to get that function CreateRandomNumber return a value...

and that other poniter thing is completly unknown to me:confused: i have a lot to learn... can you give me the solution?
 
Last edited:
Just check the string in a try/catch for now - nothing super fancy. It would check if you can use try/catch. You could also try to test isnumeric - a good idea to check if you don't know how :)

All my "pagers" are in my profile (see the button at the bottom of each post). I think it's nerseus_mcsd, but I can't remember offhand.

-Nerseus

edit: I'm no C++ guru, to be sure. I know C# pretty well and VB6 like the back of my hand. I can answer basic questions on C++ if you need them but you might be better posting in the Language Specific C++ forum if you have general-purpose C++ questions. For DirectX, check out the Graphics forum - it needs more posts anyway :)
 
only Yahoo! MEssenger there...
Do you have MSN???

int CreateRandomNumber(int RandomNumber)
{

srand((unsigned)time( NULL ) );
RandomNumber = rand()%101;

return RandomNumber;
}

how can i call a functino like this
and exctract the data from here and into a variable in the main form?

void main()
{
CreateRandomNumber(what should be placed here???*)

}

* I the variable in that position that is assigned the return value?
Where is the return value assigned?
 
vidiware said:
only Yahoo! MEssenger there...
Do you have MSN???

int CreateRandomNumber(int RandomNumber)
{

srand((unsigned)time( NULL ) );
RandomNumber = rand()%101;

return RandomNumber;
}

how can i call a functino like this
and exctract the data from here and into a variable in the main form?

void main()
{
CreateRandomNumber(what should be placed here???*)

}

* I the variable in that position that is assigned the return value?
Where is the return value assigned?

This is now finnished...
I made it complete.. now the mainfunction are quite simple calling 2 functions...

Do you want it?

Can you explain the Try/Catch statement for me?

And was that statement for solving that loop error?

Do you want the new source?
 
I was thinking you'd create two versions of CreateRandomNumber, one like this:

int CreateRandomNumber()
{
// returns a random number
// used as in:
// int x = CreateRandomNumber();
}

the second version would look like:
void CreateRandomNumber(int)
{
// sets the passed in variable to a random number
// used as in:
// int x = 0;
// CreateRandomNumber(x);
// x is now assigned a random value
}

The tricky part of the second functions lies in passing in x so that it can be modified.

The try/catch allows trying a statement and catching any exceptions that it throws. Your example doesn't actually throw an exception, so a try/catch won't work - you'll have to do an if(..) to test if what they enter is a number. But it would be good to learn about try/catch anyhoo :)

My MSN is I was thinking you'd create two versions of CreateRandomNumber, one like this:

int CreateRandomNumber()
{
// returns a random number
// used as in:
// int x = CreateRandomNumber();
}

the second version would look like:
void CreateRandomNumber(int)
{
// sets the passed in variable to a random number
// used as in:
// int x = 0;
// CreateRandomNumber(x);
// x is now assigned a random value
}

The tricky part of the second functions lies in passing in x so that it can be modified.

The try/catch allows trying a statement and catching any exceptions that it throws. Your example doesn't actually throw an exception, so a try/catch won't work - you'll have to do an if(..) to test if what they enter is a number. But it would be good to learn about try/catch anyhoo :)

My MSN nerseus_mcsd though I can't connect right now. I have ICQ and Yahoo if you have them.

As for posting the source, don't worry about it. The point is for you to understand what's going on and feel confident enough to move forward :)

-Nerseus
 
Back
Top