Aia commented: Always undefined! +14
kvprajapati commented: +1 +14
iamthwee commented: Now that's a drink... Jack Nicholson in The Shining. +0
Salem 5,265 Posting Sage
Your post makes no sense.
The implementation will run to many 1000's of lines of code in all probability, and it will be quite detailed (ie algorithmic) code, and many 1000's of lines of code if you intend to draw lots of pretty graphical animations of the results.
You make it sound like you've only just got past writing "hello world" programs.
One thing is pretty certain, you're not going to get it done simply by hacking code direct from your keyboard. You'll need some kind of design and plan for the work ahead.
http://sites.google.com/site/yacoset/Home/how-to-design-a-computer-program
http://en.wikipedia.org/wiki/Software_engineering
Oh, and keep your professor informed on what it is you're doing, just in case you're heading off in completely the wrong direction.
So did you choose this project, or were you given it?
If you chose it, why?, when you don't seem to know anything about it.
Or for that matter, be able to do a google search.
For one thing, you need to know how other people typically solve the problem before you can start on an "IMPROVEMENT".
http://en.wikipedia.org/wiki/The_Blind_Watchmaker
Plus other books by Richard Dawkins are good reading for explaining evolution.
> I am new in composting, i have a problem, it has sour smell, what should i do?
Well you could go round digging up the stinking corpses of dead threads - I'm sure that'll do something.
> You didn't need to share it because every student in india knows this
Did you read the link at all?
Because apparently most of them don't know the system sucks until the point they actually try to FIND A JOB. It's only then that they find out they've wasted 3 or 4 years of time and money for some toilet paper.
Using TurbidCrap isn't a preserve of just India either, there are schools all over the world still using it.
Apparently "help" for you means spoon-feed the immediate answer so they can go away and get a useless grade and "be happy" (for a while at least).
If enough students read the link, create enough "pressure" for change within the system by demanding an education fit for purpose, then change might actually happen. At any rate, the smart ones will take it upon themselves to seek alternatives to make sure they're well positioned in the job market.
Or perhaps it's metrics like this which make google think there are a lot of content-free threads.
Posting Games; Threads=162 Posts=56,143
Well the easy answer is to upgrade to a 32-bit compiler for your modern OS, then you get 2GB segments, not 64K segments.
But I'm guessing you're stuck with stone age tools from a stone age educational system.
The answer (if you can call it that) is to NOT have all your code in one singularly massive .c file. There's more to it, but it might be enough of a clue. Someone else will have to expand on this, or I might get around to it later on.
> The main thing is to contribute good quality postings, ask interesting and relevant questions and answer threads where you know the answer.
Perhaps you should just delete the entire http://www.daniweb.com/internet-marketing/25 tree, which seems to consist mostly of low quality link spam to dubious MLM marketers and other related scams.
Nice - you call fork() in a while(1) loop.
No wonder the system is trashed.
http://en.wikipedia.org/wiki/Fork_bomb
http://cboard.cprogramming.com/c-programming/139292-find-home-path-c-environment.html
Suggest sticking to asking on one forum at once.
http://www.catb.org/~esr/faqs/smart-questions.html#forum
or
http://www.catb.org/~esr/faqs/smart-questions.html#urgent
> At console I enter 0238284, then all the printfs outputs 0.
When did 8 become a valid octal digit?
Seems like the sort of thing that should be testable in a couple of minutes - did you try it?
> Also specify the order of precedence for variables when they need to be accessed.
Again, something that google will easily find 1000's of pages with the operator precedence table.
http://www.catb.org/~esr/faqs/smart-questions.html#beprecise
Your post reads something like "I put bread in the toaster, left it for a while and it came out charcoal - I suspect the line voltage".
Try posting some actual code, or maybe even just try to debug your code.
Using a debugger is a good approach, but you could get serviceable answers by repeatedly placing in the code things like printf("Got to the start of the foo() function with parameters %d %d %s\n",a,b,c);
A good place to start with prints is about half-way between the database query and the display. Then use http://en.wikipedia.org/wiki/Divide_and_conquer_algorithm to decide which half of the code has the problem.
> ptrdiff_t diff = (void*)p - (void*)q;
I thought any kind of arithmetic on void* pointers was undefined.
$ gcc -W -Wall -ansi -pedantic foo.c
foo.c: In function ‘main’:
foo.c:10: warning: pointer of type ‘void *’ used in subtraction
If you want the number of bytes, then ptrdiff_t diff = (p - q)*sizeof(*p);
might be a better choice.
> Is it sad I played Pong for 3 hours?
Not as sad as
Creating a thread on a forum about it
which in turn is not as sad as
Replying to such a thread
> I have a new found respect for programmers and programming in general.
LOL - and you want someone to do your homework after that little speech.
No, stop, my sides are splitting, I can't stop LAUGHING!!!!!!!
Thanks kid, that's the best funny I've seen in a long while.
Good luck with the homework, feel free to come back when you've made an actual EFFORT.
It's a function of your OS and compiler.
If you're using a protected OS and your compiler is compatible with your OS (say Linux+gcc or Windows+visual studio), then you're dealing with logical addresses. You can invent whatever address you like, but if you choose badly, the OS will just serve up your ass on a plate with a segmentation fault.
If you're using a protected OS and your compiler is NOT compatible with your OS (say Windows+TurboCrap), then you're dealing with physical addresses in a virtual machine. You can invent whatever address you like, but the VM will either allow it or give you some fake answer (which is mostly in keeping with what the real machine would do).
If you're using a real mode OS (eg. DOS), or no OS at all, then you're using real addresses, and you can do whatever the hell you like. This includes destroying your hardware if you choose badly. There is no safety net, you're on your own.
http://www.google.com/search?q=pdf+file+format+specification&ie=utf-8&oe=utf-8
1st link takes you to a 700+ page document telling you all you need to know.
Well the answer would begin by you producing a debug build, then running the code in a debugger (say WinDbg), and from there finding out some actual usable information about the crash.
As opposed to merely speculating about where the problem might be with little or no evidence (at least none you bothered to tell us about anyway).
It seems Arbus is more confused about multi-dimension arrays than you are.
> But you are passing multidimensional array. So declare A accordingly (char **A[3] or char *A[3][3]).
But neither of these things are anywhere near char A[][3][3], which is what the OP had to begin with. char (*A)[3][3] would have been OK, but your permutations didn't go that far.
All that was needed was fixing how to pass the array parameter to the function in the first instance. Everything else was OK.
#include <stdio.h>
void displayboard(char board[][3][3]);
int main()
{
char board[3][3][3] = {
{
{ "123" },
{ "456" },
{ "789" },
},
{
{ "ABC" },
{ "DEF" },
{ "GHI" },
},
{
{ "!%^" },
{ "&()" },
{ "+-=" },
},
};
displayboard(board); //!! No *, & or subscripts here!!
return 0;
}
void displayboard(char board[][3][3]) {
int i, j, k;
for ( i = 0 ; i < 3 ; i++ ) {
for ( j = 0 ; j < 3 ; j++ ) {
for ( k = 0 ; k < 3 ; k++ ) {
printf("%c ", board[i][j][k] );
}
printf("\n");
}
printf("---\n");
}
}
Not a single * to be seen!
1) What are the rules of this function structure? A link to a website explaining it would be awesome.
This is how function parameters were defined in what is known as "K&R-C", which existed before ANSI/ISO got in on the act.
http://stackoverflow.com/questions/22500/what-are-the-major-differences-between-ansi-c-and-kr-c
2) What are the advantages of this function structure?
Really old compilers will still work.
> Are there disadvantages?
No cross-function type-checking would be one biggie.
2.A) If there is no difference, Is it just a style of writting parameters? Is there an advantage to the style itself?
No, see above.
2.B) Is there any difference in the machine code generated by the compiler between this style and the standard style?
The caller might generate different code, because it doesn't really know what the prototype for the function should be.
3) Is there a name or term to this function structure? If so what is it?
See above.
4) Is this standard C or is this a gcc extension of some sort?
No, it's a backward compatibility thing for the dim and distant past.
g++ -S foo.cpp
will produce a foo.s file, which is the ASM code corresponding to your source code.
If you use custom makefiles in c::b, you might be able to generate them automatically.
It depends on how you correct your spelling mistake.
http://en.wikipedia.org/wiki/Ellipse
If you want to draw a mathematical figure on screen.
http://en.wikipedia.org/wiki/Ellipsis
If you want to know how something like printf(const char *format, ...);
works.
> far and near are reserved keywords in C (not standard, but common, it is a relic from the times of 16bit architectures)
They're reserved identifiers only in compilers for the x86. C itself pre-dates DOS (and the x86), and didn't have these keywords. Likewise, compilers for other languages which ran on x86 also needed to know about the hacky segmented memory models.
What many modern compilers have in some system header file (particularly any with a DOS heritage) are
#define near /*not useful in 32-bit*/
#define far /*not useful in 32-bit*/
So that when used in the correct context, say far char *ptr; // 16-bit
would become char *ptr; // 32-bit
through the magic of the pre-processor.
But using them inappropriately, say void foo(int near,int far){dofunc(near,far);}//Syntax error, expected primary expression before , and )
expands to void foo(int ,int ){dofunc(,);}//Syntax error, expected primary expression before , and )
I would suggest you read up on this, and practice on a 2D TTT to begin with.
http://en.wikipedia.org/wiki/Minimax
And yes, it's all about loops, and not copy/pasting the same code 200 times.
> I am trying to write out all the possibilities right now which will take up about 189 lines.
Wait until you get to something like chess. You're going to need a much bigger universe.
http://en.wikipedia.org/wiki/Shannon_number
Try a bigger stick, maybe it will knock some sense into them.
http://en.wikipedia.org/wiki/Cyberstalking#United_States
Well on the Linux box, you do this.
gcc -g prog.c
valgrind ./a.out
valgrind will tell you a lot about all kinds of memory abuse (overrun, use after free, uninitialised accesses etc).
When it is clean in valgrind, have another go on windows.
> or is the setting j on zero only change, cause i tried that already but it doesn't work.
No, the other change is changing <= into <
Post your latest code.
> What's yours.
I walk past it twice a day.
> How do you keep in shape.
Is "round" a shape?
> void main ()
main returns an int, not void.
> for (int i=1; i<=row; i++)
Every for loop is wrong. Arrays start at 0, not 1
So for (int i=0; i<row; i++)
I dunno, what have you been doing all this time?
http://www.google.co.uk/search?hl=en&q=text+extraction+from+heterogeneous+image+using+mathematical+morphology&sourceid=Mozilla-search
> Still date i dont have an any source code or algorithm for extract the text
Well you see, where I come from, a thesis is where YOU do the actual hard work of coming up with something new and unique.
But if your plan was based on "here is a snazzy thesis title, I'll just google (or beg / plead / steal) the answer off the web", then I (and many others) would be quite happy just to watch you fail.
Or as a last resort, just write your phone number on the exam paper
Hey, you got a magic bit of paper saying "pass", but will it mean anyone would want to exchange their money for your time?
Well you could try waiting more than 30 minutes before finding more forums to spam.
http://www.dreamincode.net/forums/topic/235527-custom-build-actions/
http://www.catb.org/~esr/faqs/smart-questions.html#forum
You should give it at least 24 hours before wandering off to try your luck somewhere else (not 30 minutes).
@Percila
http://en.wikipedia.org/wiki/Argument_from_ignorance
Your "argument" is basically
- all buildings have a designer
- therefore all things have a designer
- therefore humans must have been designed
- therefore god exists.
You might want to do a bit more research before just signing up to a forum so you can jump on the end of the nearest 'god' thread and give your minority (yes, that's right, pick any faith, and there are more people who don't believe it than do believe it) viewpoint speech. In particular, the rules of logical deduction would be a good starting point.
> That is justification.
It seems more like a "circular arguments are good because they are" kind of thing to me.
crock of shit
http://en.wikipedia.org/wiki/List_of_deities
Have you systematically researched each one of these before rejecting them, or did you just dismiss them out of hand as being "a crock of shit". Chances are though that you didn't know there were so many to choose from.
Did any of these 'gods' ever exist (or could have existed in your world view where gods can exist)?
Did such gods cease to exist when there was no one left to believe in them?
Or could they still exist and be thoroughly pissed off at the moment?
Will your god cease to exist when no one no longer believes in it?
Still think evolution is a myth - look at all those gods who emerged for a while, then went extinct. The end of your god is as inevitable as is was for all those others who no longer have any believers.
The only difference between you and me (an atheist) is that I stopped at ZERO gods, but you somehow stopped at ONE. Did you really choose your god, or was it handed down to you through parental indoctrination or peer pressure? Have you in fact even made a choice at this point? Who owns your mind?
One man's religion is another man's belly laugh. Increase the fun in your life by laughing at one more.
Ohh look, cross posting
You're already comfortable with manual spamming, I see no reason to help you automate the process.
You look at your first post in this ancient thread and think WTF.