I can actually see a problem in your code:
checkout in your ReadLine function, you're using LastChar without having any data there, it's actually undefined.
try something like:
LastChar = ' ';...
Type: Posts; User: Vber
I can actually see a problem in your code:
checkout in your ReadLine function, you're using LastChar without having any data there, it's actually undefined.
try something like:
LastChar = ' ';...
You can use a recursive function to do that, though it's very easy to convert it to an iterative version... here's an example:
void Bin( unsigned int n )
{
if( !n )
return;
Bin(...
Hello :)
First of all, it doesn't really help us you posting only part of your code, as you saw in the previous reply, he got lost in your code because the line jumping.
About you fopen( ), I...
you mean, you have in a string "sin(pi*x)" and you want to call it directly by the string? I don't think it's possible. But, if you have pi and x defined in your code, just call it, but not from a...
C++ is a superset of C, this means that C++ contains all what C contains, and some other things. Now, what you can write in C, of course it is possible to do with C++ (some say that what you in C++,...
Ohh now its perfectly clear...
and ygfperson, ok it's old but not like this :)
>And yes, this would be old style C, because the book is old... Copyright 1998.
No way ;) 1998 and still use old-fashion function declaration? what is the name of the book?
I think in the FAQ, there is an example, search it.
Gcc and a good editor is fine... but an organized IDE is better if you're going to deal with huge projects. What you can do with C? everything, it's a general purpose language, the language itself,...
Use code tags, also few problems:
>>void sh(char *);
>>void sh(char *cmd)
First you defined, now you didn't write the function, do something like this, first declare the function, then write...
I don't understand the main idea of the program, unleast we develop an AI type of program that know to create correct and meaningful sentences, the program will be very small and I think we'll have...
>You can only declare variables at the beginning of a block.
I can declare them outside a function as well, without any block, the global variables, can't I? :confused:
Something like the Centrino?
/* Aren't you a little biased, though? POSIX is right above your avatar? */
Far away from this, you look in the Linux board FAQ, a little bit about POSIX.
/* And why do so many people use gcc...
1) Currently I'm not living in USA, but I'm going to travel 45 days in July and August. I'll be in NY and North Carolina.
2) Nothing so far.
3) I wouldn't mind if is a small fee.
4) I wont...
Did you read about the GPL (General Public License) ? If not try reading from The GNU Site .
You can read about LGPL (Lesser General Public License) too, it's very interesting, read it here
Read the GCC documentation, it's very easy. One way to compile a file is: gcc file.c -o file
Of course you can use some parameters witch might be needed to your program, see the documentation.
But I can use in C++ printf, can't I?
But still what can be done easier in C than in C++, it's up-to-you, somepeople,they're more familiar with C, then their job of course will be easier and faster,...
One thing, you don't check either you successfully allocated memmory, it's always good to check...
char *str = malloc(5);
if(str != NULL)
//use the memmory
I don't think anyone told you but
>>while(!feof(fp))
is a big no-no, you should try looking at the FAQ to see "why".
Iterate trough it and clear it by yourself, btw, what you mean "clear", delete the current data there is in this array? Also pick up in mind that we're talking about a huge array, doing this...
well, it's really machine dependent... but in your case if it's 2, and you're still receiving 8, strange.
and what you expect to print? sizeof returns you the size of this struct, not how many elements you have on it. So 8 is perfect, look:
struct customer {
short number; // ...
You can search some projects in planet-source-code or you can try to read "Beej Network Guide" and try to build one by yourself.
sizeof(struct customer);
or typedef and you could use just customer.