Let me guess, this is just as bad as strcpy()?
strncpy(str, "Hello World", strlen("Hello World"));
Snidjer - Tue Jun 24, 2003 4:28 pm
Post subject:
No, it's better, and in real life, when you're doing strncpy with variables, you will probably be using strlen() on those variables. Good insight.
Devon
Doggeti - Sun Jul 20, 2003 8:20 am
Post subject:
I need help again.
I have:
char *time; // time is for example '12:34'
int minutes;
int seconds; |
How do I get the minutes and seconds from the string (in this case mins=12 and secs=34) and convert them into integers so that the values are in the both integer variables?
Smong - Sun Jul 20, 2003 12:28 pm
Post subject:
sscanf(time, "%d:%d", &minutes, &seconds);
You can try "%2d" if there are always two digits, fx: "00:01", though I doubt it will make much difference.
Doggeti - Sun Jul 20, 2003 4:08 pm
Post subject:
Thx! That works fine.
GameMaster - Fri Aug 15, 2003 6:04 pm
Post subject:
Could someone tell me what diffrences are between C++ and Java????
Cyan~Fire - Fri Aug 15, 2003 6:35 pm
Post subject:
Uhhhh.
C++ is a text-oriented language, and is widely used for almost everything. Complex.
Java is graphic/object-oriented language, and is widely used only on the internet. It has some other uses, but mostly for executables, C++ is the way to go. Java's a heck of a lot similar too. (I can understand it
)
Please anyone more experienced correct me on any points.
GameMaster - Sat Aug 16, 2003 4:16 am
Post subject:
I looked at some of the code and it looks like it is a mix of java and php.
can it be?
Cyan~Fire - Sat Aug 16, 2003 12:29 pm
Post subject:
Lol no way. C++ is based on C which has been around for ages.
Almost all programming languages look the same, if you think about it. They just have very different functions. php is nothing like C++ since it handles web pages, and C++ does kinda behind-the-scenes stuff. And I already said how Java is different.
If you want to get into programming, I suggest starting with Visual Basic, and working your way up to C++.
MadBoy - Sat Aug 16, 2003 6:05 pm
Post subject:
ok nice to know... ill try
GameMaster - Sat Aug 16, 2003 6:06 pm
Post subject:
php handles php-pags
php its if($s==$b){echo "****";}else{echo $b;}
java... (we learned it @ school) ...is useless (there was no useful programm we have done).
in java its if(s==b){system.out.print(ln)("****");}else{system.out.print(ln)( b);}
They look nearly same... no matter what they are for!
... visual basic????
no thx that dosnt even look same!
I think VB is just 4 MS office access... never saw it snywhere else.
Is is really to hard to learn C++ from mixing php & java????
... im posting shit i know.... lol