The problem is when somebody first asks a question in forum, sometimes it is hard to determine his/her level of knowledge. Sly said don't worry about the language, it just needs a function that you can find in MSDN. I think all programmers in the whole world know that the resource of Windows programming is MSDN. So giving it as an answer is useless and Sly can explain his answer himself.
What I meant was that don't take somebody's answer as an absolute answer, this is a forum, and you can wait for others.
If your course includes C as the programming languages, there is no way to escape from it. But learning any structured language means learning structured programming and it will be easy to learn a new structured language quickly.
Once I migrate from QBASIC to C, I was really confused: Why they say this is a powerful language? It can't even do simple things. Compare:
Code in QBASIC:
Code:
INPUT "Enter your name: ", name$
INPUT "Enter your age: ", age
Var$ = name$ + " is " + STR$(age) + "years old."
PRINT var$
The equal code in C:
Code:
#include <stdio.h>
#include <string.h>
int main()
{
char name[20]="";
char var[50]="";
char age[6]="";
printf("%s","Enter your name: ");
gets(name);
printf("%s","Enter your age: ");
gets(age);
strcat(var, name);
strcat(var, " is ");
strcat(var, age);
strcat(var, " years old.");
printf("%s\n", var);
return 0;
}
C eats more code and if your name be more that 20 chars program crashes. If you enter the age "none of your business" it again crashes. Even if you enter "tt" for age it will accept it because age is an array of chars. But none of these is the case in QBASIC.
It is possible to correct these errors of course (with use of scanf() maybe), but it is not easy and takes much time for somebody that wants the computer to do a job and don't want to know how it will be done by it.
The problem with C is that you have to know many non-relevant things, to do a particular job.
This is a place where people share their knowledge and experience unlike in many other places where people hesitate to share their knowledge due to professional jealousy and internal politics (which I observed from my practical experience).
I agree, all people here should try hard to keep it right.
Sorry, my composition is not as good as you.