> I think uninitialized end doesn't make any problem...
Well you could try printing it as well, just to see how badly you're screwing up.
> May you correct the mistakes and upload cpp file again ?
Nope.
We point out problems, you fix them.
> I think uninitialized end doesn't make any problem...
Well you could try printing it as well, just to see how badly you're screwing up.
> May you correct the mistakes and upload cpp file again ?
Nope.
We point out problems, you fix them.
Just use the find command - this is bread and butter for find.
$ find work -daystart -mtime -1 -size +2000c -ls
327592 4 drwxr-xr-x 2 forum forum 4096 Feb 17 16:18 work
327419 12 -rwxr-xr-x 1 forum forum 9339 Feb 17 16:18 work/a.out
$ find work -daystart -mtime -1 -size -2000c -ls
327355 4 -rw-r--r-- 1 forum forum 439 Feb 17 16:18 work/foo.c~
313613 4 -rw-r--r-- 1 forum forum 443 Feb 17 16:18 work/foo.c
Well right at the start
Huffman::Huffman
end is uninitialised.
Then later on...
long begin,end;
begin = output.tellg();
output.seekg (0, ios::end);
end = output.tellg();
This local variable shadows your member variable, and you're still out of luck.
Are these libraries built for dev-c++ (or MinGW).
You can't take take libraries originally aimed at say Visual Studio and use them "as is" with your compiler.
Options
- there is a library conversion tool somewhere to alter the format of libraries
- ask whoever gave you the libraries to sent MinGW/Dev-C++ compatible ones
- get the axutil source code and build the libraries yourself.
Can you post the complete compile and link log as well.
You need to strip the newline off the end - did you notice the line break in the invalid option?
Try str = strtok(NULL, " \n");
Did you tell the linker
- where to find the axutil library
- to actually use the axutil library.
The #include in your source code just tells the compiler that something exists (like say cout). But you also need a library for the actual implementation, and that's where the linker comes in.
Standard things like the library containing cout are automatically linked for you, so you don't tend to notice what is going on.
Nope - if you can't be bothered to make a decent job of presentation, then I can't be bothered to read it.
Like the sig says, post crap and be ignored.
If this were a CV, it would have gone in the bin in a hot second.
http://sourceforge.net/apps/mediawiki/cpwiki/index.php?title=Indentation
Your code is awful to look at.
While you're there, look up void main as well.
You should declare your own argv, rather than trying to use the one passed in main.
Also, you'll need to make sure your last argv is NULL.
But a recursive function in C++ would be no different to a recursive function in Java. There is no C++ magic here, almost every language can manage recursion.
But if you don't understand the need for a stop condition (as Dave points out in post #4), then you're stuck anyway.
If you translated what you wrote back into Java, it would still spin out of control until it ran out of some resource or other.
> What have i done wrong now?
You've changed your code, and we don't know what you've done.
Post the latest code.
> the output file will have no characters if the input file has no characters.
i = 0;
After the first loop of NO characters, i is still 0.
Your 2nd loop begins with i >= 0, it executes ONCE
You've just written a garbage character to the output file.
> Im concerned because if the input file has more than 100 characters
Indeed, reversing a very long file would indeed be a problem.
Are you allowed to assume the file will fit in memory?
If you want to know more about what WaltP said, then
A short intro:
http://www.randelshofer.ch/fhw/gri/float.html
The long and gory details:
http://docs.sun.com/source/806-3568/ncg_goldberg.html
> Is there a more efficient way 2 do it?
Well there are no simple ways of doing it more efficiently.
Also, if your input file contains no characters, how many characters are you writing to the output file?
#IND is for indefinite.
You may also see #NAN and #INF from time to time as well.
All basically mean the same thing, and that is your calculations were way off (possibly the result of garbage data).
Here's a nice short intro to all the different things floats can represent.
http://www.randelshofer.ch/fhw/gri/float.html
p_bIsolated != 0
would seem to be a lot less obscure, whilst meaning about the same thing to the compiler.
> //Is this correct if I want to copy the 100 values in myspace to array?
Had you tried it, you would have gotten a compilation error.
The answer to the other question is yes.
> *(pmyspace+i);
You can even write pmyspace[i];
grep by itself just matches strings. It doesn't care what comes before or after.
Try something like df -g | egrep '/oracle/BP1/sapdata1$'
That is, the line ends with sapdata1, not just contains sapdata1 (like sapdata10 contains sapdata1)
You need to post an actual example code which crashes.
Deleting a bunch of stuff, then saying "something like this code crashes" isn't good enough. You've almost certainly deleted the true cause of the problem and just posted where you think the symptom is.
+18?
You're not even close!
http://www.tomshardware.com/reviews/5-ghz-project,731.html
However, one core stuck at a specific temperature doesn't look good.
Can you see it doing things in task manager -> performance (select 1 graph per CPU)?
I spent as much time thinking about my first answer, as you obviously spent thinking about your first question - in other words, a few seconds at best.
Your effort (asking a decent question, and showing some background in trying to solve it yourself) is rewarded by a reasonable amount of attention on our part. If it looks like you just typed the first thing that came into your head, then don't expect hours of research and detailed posts from us. Most of us have got far better things to do than be your personal search engine interface.
http://www.catb.org/~esr/faqs/smart-questions.html#answers
http://www.catb.org/~esr/faqs/smart-questions.html#explicit
Well the error message says it all really.
It's complaining about an _
So do as it says, and add an _
Simple? No?
More than 4800 per day?
More than 33600 per week?
If not, it's just a scheduling problem.
And if you're willing to go for 'cheap', what's the next price break from your current host provider to allow more emails per time period?
A random hit from a search - https://www.edson.net/
They do an email only service for $30/pa
Scroll down to "EMAIL ONLY SERVICES"
Why can't the host you're on send emails?
If it can't, I can't see how it's fit for your purpose.
Here's a list
http://en.wikipedia.org/wiki/Comparison_of_file_comparison_tools
I use this pretty regularly
http://en.wikipedia.org/wiki/WinMerge
But you might want something else if too many files have moved between matching folders.
> uint32_t fatsz = htffs.fatsz;
Well that's the whole POINT of handles, and that is to be opaque for external users.
It's basically the same as the 'this' pointer if you had a C++ class. It's just a magic token you pass to each "member" function of the public interface so it can distinguish between various instances.
It is no more wise to try and smash your way through an anonymous struct to get at the data behind it, than it is to smash your way through a class to rummage around with the private variables.
// ... the function will have two formal parameters: an array
//parameter and a formal parameter of type int that gives the number of the
//array positions used. The numbers in the array will be double. ...
Is
double func ( double *array, int numElements );
http://docsrv.sco.com/cgi-bin/man/man?ios+3C%2B%2Bstd#ios
The type is a bitmask type T3 that describes an object that can store the opening mode for several iostreams objects. The distinct flag values (elements) are:
* app, to seek to the end of a stream before each insertion
* ate, to seek to the end of a stream when its controlling object is first created
* binary, to read a file as a binary stream, rather than as a text stream
* in, to permit extraction from a stream
* out, to permit insertion to a stream
* trunc, to truncate an existing file when its controlling object is first created
Try with only in, out, binary.
Then seeking should work as you describe.
To actually read input from the child, you need to set up a pipe().
One end you make the stdout for the child, and the other end you can read directly from the parent.
> I create a membuffer for a 1Gb file (this was made from 25Gb file)
Start with something smaller, like 1Mb instead.
If your buffer is too large, then it will just end up in swap space (yet more disk accesses). Every part of the file will then require TWO disk accesses to process rather than just the one.
> I have tried using the exit() function to pass the sum back, but just keeps giving me 0 back as the exit status.
That's the result of the exec() call, not the result of the child process.
To get the result from the child, the parent uses one of the wait calls, then examines the resulting status value to get the exit status of the child.
But your spec said the child should also print things as well right?
Yes you can do that.
But details do vary from one compiler to another (and the kind of machine you're running on).
Well you could try indenting your code.
The last return 0; seems WAY WAY out of place...
Do you have a menu option for "Character Encoding"?
Because it looks like UTF-8 encoded UNICODE to me.
> data[i*n+i] = 1.;
Well this would appear to walk MASSIVELY off the end of the allocated space.
You need to allocated n*n for a square matrix.
> int main(int num1, char op, int num2)
Read your book again. You can't just make up an interface for main.
It's int main ( int argc, char *argv[] )
argc
tells you how many args there are
each argv[i]
(from 0 to argc-1) is a string parameter.
You could add these two lines before invoking python
echo %CD%
pause
Adding a pause at the end as well would be good, in case it is reporting errors.
Also, calling it a .cmd file would be preferable to a .bat file.
IIRC, there's some historic "backward compatibility" associated with .bat files, one of which may be that %CD% is undeclared.
$ set /?
...
If Command Extensions are enabled, then there are several dynamic
environment variables that can be expanded but which don't show up in
the list of variables displayed by SET. These variable values are
computed dynamically each time the value of the variable is expanded.
If the user explicitly defines a variable with one of these names, then
that definition will override the dynamic one described below:
%CD% - expands to the current directory string.
Also do cmd /? to find out how to enable "Command Extensions"
Your prototype and implementation do not match.
In the same directory as the .exe might be a choice.
As would the "root" directory of your project.
IDE's, when running a program, can often be told where to assume the current directory is.
Someone else who thinks they're an exceptional case to the rules.
http://www.daniweb.com/forums/announcement8-2.html
Sure we "help", but that doesn't mean we spoon-feed you the answer.
The 'e' forms pass the environment.
The 'p' forms (which you're not using) are the ones which search the PATH.
If you know such things are called 'quines', can you use google for the rest?
So where you do use it AFTER you have incremented it?
So far, you only print it once, when it's value has been initialised to 1.
Who knows what the author regards as the title - there are so many different places to put it, with no obligation to use any of them.
There may be a document properties field called "Title".
There may be some text formatted with the style called "Title". But what if it's used more than once, what then?
It might be the first line of the document.
It might be the text in the largest / bold / underlined font (not necessarily the first line).
It might be the text which is preceded by the word "title:"
Or it might simply have nothing which could be reasonably be called a title.
If the first one isn't present, then you're basically reduced to guess-work in one way or another. In all these other cases, you need to look at the sample of documents you have, and come up with some kind of heuristic which gives good results most of the time (and an error message when it doesn't).
http://en.wikipedia.org/wiki/DDR2_SDRAM
In principle, yes.
But the older modules might have a lower clock rate, which would lead to inferior performance.
Also, how many RAM slots does the netbook have? It seems to me that such a small form-factor would have only one slot. You can't add more memory without taking the stuff you already have out.
Plus there are limits on what you can mix-and-match even if there are two slots, and one of them is free for you to use.
> pointer = pointer->next;
This makes your pointer NULL when you get to the end of the list.
> while (pointer->next != NULL);
This is wrong.
This would be better
while (pointer != NULL);
First, INDENT YOUR CODE!
It might look all nice and neat in your IDE, but that's only because it can handle mixed spaces and tabs intelligently. Forums (or eventually, any tool you come across) will make a mess of tabs. So your nicely formatted masterpiece instantly turns to cack!.
Change your editor to only use spaces - don't worry, you can still press the tab key and it will still do what you want.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct words {
char word[255];
int count;
struct words *next;
} *start, *pointer;
int statistics();
int main()
{
statistics();
return 0;
}
int statistics()
{
FILE *fp;
int a, pom;
char quest[255];
start = NULL;
fp = fopen("file.txt", "r");
fscanf(fp, "%s", &quest);
pointer = (struct words *) malloc(sizeof(struct words));
start = pointer;
if (pointer == NULL)
return 0;
strncpy(pointer->word, quest, 255);
pointer->next = NULL;
++pointer->count;
while ((a = fscanf(fp, "%s", &quest)) != EOF) {
pom = 0;
pointer = start;
do {
if ((strcasecmp(quest, pointer->word)) == 0) {
++(pointer->count);
pom = 1;
break;
}
pointer = pointer->next;
}
while (pointer->next != NULL);
if (pom != 1) {
pointer->next = (struct words *) malloc(sizeof(struct words));
pointer = pointer->next;
pointer->next = NULL;
++pointer->count;
strncpy(pointer->word, quest, 255);
}
}
pointer = start;
do {
printf("word %s X %d \n", pointer->word, pointer->count);
pointer = pointer->next;
}
while (pointer->next != NULL);
return 0;
}
Second, use a debugger.
Eg.
$ gcc -W -Wall -ansi -pedantic -g foo.c
foo.c: In function …