I have a bit of simple code here that seems to work fine in my program BUT, I get this warning and I cannot find the solution anywhere. So I turn to the forums. Inside this *.h file on a Fedora...
Type: Posts; User: brightmatter
I have a bit of simple code here that seems to work fine in my program BUT, I get this warning and I cannot find the solution anywhere. So I turn to the forums. Inside this *.h file on a Fedora...
I am using Cygwin on my windows 7 machine. I open a 'cmd' with administer privileges and type: gcc -Wall -m32 main.c
I get "access denied".
I have checked my environment variables and the...
So my options are to corrupt(truncates) the data or to have an overflow?? That just seems wrong somehow. Nothing against you, but more against the idea of a hard coded limit like that. Honestly,...
So what you are saying is it is not possible to have this useful little gem while running on windows. Is this why Windows has so many buffer overflows? Isn't there any way to use scanf safely? By...
I have tried many things to get this function to work on multiple Windows OSs (XP, Vista, Windows 7). It works fine in Linux. I have updated my compilers to the latest versions. I have tried MinGW...
It was my impression that sizeof didn't lie so much as it just includes the null terminator at the end of a C-style char array
duly noted about card arrays.
Are you sure that strlen() does not require any non-standard libraries?
Well, I had tried this...
char ca[] = {'E', 'n', 't', 'e', 'r', ' ', 'a', 'n', ' ', 'i', 'n', 'd', 'e', 'x', ':', ' ', '\n'};
for(i = 0; i < sizeof(ca); i++) {
putchar(ca[i]);
}
...and as...
yep.
Well, not anymore because I am using the command you gave me. :)
Issue solved:
To avoid this thread going down a road that might be more practice than solution, I suppose I had better just post the working code and say we are good. Apparently Windows XP is not...
setvbuf(stdout,NULL,_IONBF,0); works GREAT! Much easier and applies to every printf I do. Thanks.
I did the below... seems to work but you are right that it will not do printf stuff. I will read the link to see if I can come up with something.
void print_string(char print_this[]) {
char...
Ok, I tried this (likely ignorant) approach. The problem is that I am seeing now is that when it passes the char[] "Enter an index: " it only really gives the function 32-bits worth (i.e. four...
One disadvantage of learning a higher language first (like Java) is that you tend to assume every language will guide you, inform you, protect you and generally coddle you. I get in to C and it does...
yes, printf works but it will not appear until after the main has returned... no printf or putchar will show anything in console until end of program. I also tried this:
char ca[] = {'E', 'n',...
I am using the most up-to-date eclipse IDE for C/C++. I have the below code. It seems simple enough. My problem is that no printf will display on the console until the main has finished (return...