yeah and I had stupidly ignored exactly that.
d = tmp = new data;
:)
And I never claimed to know C++ well...I have always written code in C.
I have been introducing myself to C++ lately. ...
Type: Posts; User: zombiezparadize
yeah and I had stupidly ignored exactly that.
d = tmp = new data;
:)
And I never claimed to know C++ well...I have always written code in C.
I have been introducing myself to C++ lately. ...
#ifdef C
#include <stdio.h>
struct data {
char text[1024];
data *next;
};
data *readData(FILE *in)
{
The "do some default" or "do nothing" was exactly what was missing from the code!
Which means when there are no arguments passed to the program the code will merrily
throw SIGSEGV as it is going...
On going through the post again, yeah I agree it is asking a pretty vague or rather a question that is too obvious.
I was more concerned about the the comparison.
If the programmer were to write...
I was called for a Code review and I saw some code as below:
if(argc!=1)
Whoa!
To this I got the response from the programmer saying:
Now my question is, what would be the better way...
That's exactly the question I want to ask!
That's what the description on the man page says.
And the Usage says:
I guess that makes it clear to you why your code is dumping core.
I'd recommend writing a signal handler to work with...
Did you get a fix for that? I cant see a reason why that should happen!
Initially looking at the datatype char I thought its the structure boundary thingy which says that a structure should end on...
Of course you CANT!
You have not allocated any space for the pointer f!!!
I have entered comments in your code! Go through them.
yeah, I too have known that, but someone had just confused me... :D
Thanks! ;)
Hi,
I am building an examination server.
Will it be a wise idea to let the server choose a random port and listen on it rather than using a fixed port? And if the requirement is such, how would a...
Try Andrew S. Tanenbaum's book.
Or may be even Introduction to Algorithms by Cormen.
Fixed!
Yeah sorry I was an idiot not to look at the correct settings for the Keyboard.
Mine was set to English (International) however, we use the Engslish (USA) settings in India and that's what...
I have checked the Keyboard settings and I have my region set to India and have the keyboard set to Dell Inspiron Laptop (yeah I was pleased to see that option).
Hi,
If this is completely out of contest, the moderators may delete it without warnings.
I have facing this strange problem. I have a Dell Inspiron 1520 laptop and I use Fedora Core 8 via VMWare...
Getting answers from us wont really help if you dont try to find solutions yourself.
Try them out first and then post the problems you face.
I have personally worked on GUIs using C/C++ supporting multiple platforms.
The examples being, as mentioned in the previous post, Gtkmm, Qt etc.
I have worked on these two and I know they support...
exactly as robwhit pointed s1 does not have enough memory to store s1+s2 and hence the problem.
Make s1 an array or allocate enough memory for s1 so that it may store the length of s1+s2.
yes that is correct, writing to a File before reaching EOF will replace characters in "w" mode.
The OP can use fseek as right pointed out by prog-bman!
probably he doesn't read the replies to his posts
I think the usage and cost is situational, presuming one is more expensive than the other and to call that statement generic will not be wise.
post your problem!
which means you actually posted the code without even looking at it once or bothering to compile it?
Or just typed it from memory and never bothered to check it.
yes it should give you 4 as array is the pointer and the sizeof operator when applied on a pointer shall return you 4 on the machines we normally use today.