Your storing 2 characters in one place.
Where as ' ' can only hold one character.
A quick fix would be to define grade as
char grade[2];
Then use grade[0] = 'A' for single grade letters, and then
grade[0] = 'A';
grade[1] = '+';
User Profile
Collapse
-
Ok I found out that _WIN32 is defined in cygwin.
And #undef _WIN32 doesnt work >(
Ideas?
Actually I'l use virtualbox.Leave a comment:
-
Ok, I used valgrind to track down the memory errors.
Turns out that gethostbyname(" ") returned null on centos and I did check it before using it.
I still cant compile this on cygwin.Leave a comment:
-
-
Sorry I couldnt edit the post above, but compiling on centOS, compiles and links fine. But running, the only output I get is:
Segmentation fault
No warnings/ouput popped up whilst g++ was compiling/linking.Leave a comment:
-
Ok turned out I needed to use the -mno-cygwin option for g++.
But help the on the object file directory would be nice.
Edit: Now I seem to be undefined linking errors:
Code:memoryhandler.o:memoryhandler.cpp:(.text+0xc1c): undefined reference to `_GetPro cessMemoryInfo@12' errorhandler.o:errorhandler.cpp:(.text+0xf70): undefined reference to `_WSAGetLa stError@0' errorhandler.o:errorhandler.cpp:(.text+0x1840):
Leave a comment:
-
In explorer, tools->folder options->view:
Is "show hidden files and folders" selected
And if you are looking in system directories:
Is "Hide protected operating system files" unchecked.Leave a comment:
-
Cygwin sockets: getaddrinfo undeclared
Im using cygwin to test the code of a server I am writing.
I've included sys/types.h, sys/socket.h, netdb.h, and arpa/inet.h.
And this is the output..
Code:../../../sockets.cpp: In constructor `network_class::network_class()': ../../../sockets.cpp:64: error: aggregate `addrinfo hints' has incomplete type a nd cannot be defined ../../../sockets.cpp:69: error: `getaddrinfo' undeclared (first use
-
Install vista sp1 (After previous install failed)
Hi all,
The last time I installed windows vista (home premium) sp1 from windows updates, it failed to install after boot, and kept failing on each boot. So I re-installed via the system recovery option at POST (PC has a seperate partition with windows backup files)
So its been a month sinse then, most of the stuff is installed on this pc now.
What is the chances of this happening again?
I cant quite the... -
It turns out the perl script isnt built for activeperl, (only on win)
So, Im back to the IO:Compress:Gzi p problem again.
cpan, sais the module exists, but when I download the newer one, it fails to make it.Leave a comment:
-
Aha I got it working, it required active perl.
How do you replace the original perl with active perl?
I added activeperl /bin/ to PATH, but it would conflict with the old perl?Leave a comment:
-
CentOS vps, linux isnt my primary OS.
I'l check the paths the script is using, and if Gzip actually exists.
Where are the modules located?
(locate doesnt work because of a missing db)Leave a comment:
-
IO::Compress::Gzip problem (CentOS)
Im not perl expert with perl, and I am trying to run a server script (that I didnt write).
And perl reports:
Code:Can't locate IO/Compress/Gzip.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7
-
Why are global variables considered bad?
I was thinking of adding some global vars to my program when I stoped to think why they are considered harmful.
I read on a google result that they can get mixed up with local variables, but that can be simply fixed with a prepended global_ or something on the lines of that.
I remember reading somewhere about them causing security or memory leaks or something like that.
Is that why? or is there more to it? -
-
-
Ok, thanks for your help.
But the client still freezes up, even on localhost.
Could there be anything else, say if there was a problem with recv or something?Leave a comment:
-
Ok, would this need to be set on the client as well?
I applied the setting on the server, but I get the same result.
I used this:
setsockopt(List enSocket, SOL_SOCKET, SO_KEEPALIVE, (char*)&bOptVal , bOptLen)
If I did need to set on the client, how can I apply this with sdl_net?Leave a comment:
-
c++ Winsock problem
Hi,
I've been getting this problem when after a certain ammount of sent messages to the server, the client would freeze up. And the only way to un-freeze the client would be to close the socket via the server.
I'm making a server for a simple 2d game (which I didnt make) and it uses sdl_net.
Before I post all the source code, does anyone reconise these sort of problems? -
You can ask on specialized Win32 api newsgroup :
news://comp.os.ms-windows.programmer.win32
where it has often been discussed
No activity results to display
Show More
Leave a comment: