strettonman: it can't be that way because it's inside an "ifndef" statement (if not defined). That means it hasn't already been defined yet.
49 # ifndef _WCHAR_T_DEFINED
50 typedef unsigned short wchar_t;
51 # define _WCHAR_T_DEFINED
--------------------------
The best answer to your...
I'm an absolute beginner in C and opengl and was trying out a test program. When I included glut.h
#include <GL/glut.h>
I got this error:
Redeclaration of C++ builtin short line 50 glut.h
Is my glut.h defective or am I doing something wrong
--------------------------
The best answer to your...
alright, that makes sense. is there anyway to do this with tr///, or would you have to do something like this:
@abc = 'a','b','c';
%alpha = ( 'a' => 1,
'b' => 2, #etc...
);
foreach $letter (@abc)
{
$num =~ s/$letter/$alpha{$letter}/;
push(@abc,$num)...
How come this code:
$text = "abcdefghijklmnopqrstuvwxyz";
$text =~ tr/a-z/1-{26}/;
print "$text\n";
produces this output:
123456789:;<=>?@ABCDEFGHIJ
?
--------------------------
The best answer to your question will definitely be RTFM.
AHA! i found your problem! it can be summed up in one word:
Mac
That's your problem.
--------------------------
The best answer to your question will definitely be RTFM.
i don't think perl is the thing for you... try other languages such as javascript, etc.
--------------------------
The best answer to your question will definitely be RTFM.
or, though i don't dare try it myself, you could try archiving the file every time it is accessed, then simply find the differences and work with those.
--------------------------
The best answer to your question will definitely be RTFM.
or something like:
open(READ,"test_file");
$file_contents = <READ>;
close READ;
$file_contents =~ s/$word//;
open(WRITE,">test_file");
print WRITE "$file_contents;
close WRITE;
I think that should work...
It would be much easier if you could change the format of the date to make the month a number, preferrably something like this:
Wed 7 16 19:05:43 2006.
It would help even more if the day of the year could be provided, for example:
Wed 226 19:05:43 2006, in which case days could simply be...
Maybe this isn't the best question to ask. I guess I was just curious... It just seemed like the users of certain programs should be able to only type one character and let the program do the rest... I don't know...
I think the first question is why are you using windows? All Unix and Linux distributions that I have seen have the bash shell. The bash shell makes perl so much easier, and it's a good idea in general to be using Linux/Unix.
The result from that code isn't quite what I was aiming for. I was looking for a way to retrieve the first character of input, which is exactly what that does. But I was also looking for a way for that to be all the user could type. The program would then move on once one character was typed.
maybe your real problem, although this probably sounds stupid, is all the shorthand you're using. try expanding it all and you might find your problem.
I'm trying to find a function in perl that takes only the first character typed in STDIN, returns it, then just moves on, like the C++ getch().
Is there any way to do this?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.