Search:
Type: Posts; User: truls
Search:
Search took 0.14 seconds.
-
Well list still have all the operations you'll need, like push_back and insert. You can sort a list in the same way as a vector and most of the operations are the same, so I don't really understand...
-
Use a list. Iterators to list elements are only invalidated if the object pointed to is removed. Otherwise insertions and removals does not invalidate iterators.
-
If you post some code we can look at that and give you some pointers. Also post the command line you are using to compile it and the errors it gives you.
-
The current path (.) is not in the default search path for an executable.
If you want to run a program in the current directory, prepend ./ to the name.
In other words:
#./test.py
And you...
-
Correction:
One little thing. The pattern should be:
/\d+/
to ensure that you get at least one digit. This ensures that the first element of the array is an integer.
+ means at least one...
-
myint = mystring.scan(/\d*/)
I think myint will be an array, so you will just have to pick the first element.
-
I'm just guessing here, but since the =~ operator seems to be the regexp operator in Ruby as well as Perl, shouldn't the code read:
if x.to_s =~ /line/
At least in Perl all regexp expressions...
-
my @array = `perl script.pl`;
Assuming script.pl prints the output as a number of lines. The command runs an external program and puts the resulting output into an array.
BTW: If you are going...
-
It crashes because you have not allocated any memory for gbuf. If you try to add:
gbuf = malloc(4096);
It will work exactly as if you were using gbuf[4096].
The reason that you don't need to...
-
Great that it's working. The reason it worked on my machine could probably be that the variables are laid out differently in memory. When you go one over on your machine, you set a pointer to zero....
-
Im reformatting and reorganizing bits of the code to get an overview, but the first thing that struck me was this:
for(z=0;z<=numberofsinks;z++)
Are you sure that you want to use <=?
Arrays in...
-
Well, it compiles and runs fine on my mac. The major problem with the code is that the define_depression is not properly formatted, you have multiple statements on a single line, and it's too long....
-
It would of course help a bit if ANSI sold the C99 standard for something less than the $281 they are charging now. Why the C++ standard can be downloaded for $20 or thereabouts while the C99...
-
Well, since till_pars contains a multi-array, which is basically pointers to pointers, if define_depressions is faulty and overwrites any of these pointers you will get an access violation when...
-
#include <stdlib.h>
You are missing the include file that defines the exit() function. "Implicit declaration" generally means that gcc did not find a definition for a function that you are...
-
I guess that ch is allocated on the stack, and if so it could be that you are writing too much to it and thus mess up the stack. The function will then crash when it tries to return to the point...
-
You could start by checking the return values of shmget and check what errno says. You get the segmentation fault because shmget is returning -1 when it faults, so if you check errno you will get an...
-
Sit down, relax, breathe in - breathe out.
I think I found it, and it's one of those really annoying bugs that C just loves to throw at you. Here goes:
*matrix[i] and (*matrix)[i] is not the...
-
Could you please post the complete program as it is, including the syntax for the file you want to read so it's possible to compile and run the program? It's getting a bit confusing as to what...
-
Interestingly enough, if you set i to 4294967196 and compile you get the following warning:
warning: this decimal constant is unsigned only in ISO C90
Also, if you check UINT_MAX (defined in...
-
Seems like this was a program that was once written to be portable, and has then been windowized. I did some hacking and got hlvis to compile (I'll tell you how to get the others going later).
...
-
If you could put the source code on a web-server or give a link to somewhere we could download it and see what it is like, that would help a lot in answering this.
-
The confusing thing is that people are using the word Java about both the language and the libraries.
Java the language is pretty simple to use, and it's probably what you have learned. It's all...
-
Find out where the g++296 command is by issuing the command 'which g++296', go to this directory and create a soft link to this command with the name g++: ln -s g++296 g++
I think that is the...
-
rec.name is a pointer to a character (or character array), but you did not allocate any memory for this array so it crashes.
If you tried changing the definition of name to, for example, char...
|
|