except that case 'n':
should be case '\n':
a simple typo, of course, but one that could drive a beginner to pull their hair out.
just sayin'.
except that case 'n':
should be case '\n':
a simple typo, of course, but one that could drive a beginner to pull their hair out.
just sayin'.
um, send a wireless command to a robot who is standing by a switch?
i didnt really get what u r saying ... i need a prog to find the num of solution ... waitin 4 a reply as soon as possible...... thx..
do u wnt da goog srch n stuf or r u wnt 4 me 2 jus prog da c code n post it str8 up 4 u 2 b chiln stuf ... kkthx c u l8r d00d lolz.
.
okay...
someone's gotta give me a cookie for that bit of cleverness.
you can call Perl scripts from C/C++, but it's not particularly useful if you plan on distributing your code to any other machines.
because you'll either need the full Perl installation (plus any obscure modules you might use) installed on (or networked to) every target machine, or you'll need a Perl Development Kit ($$) to build super-freaking-huge EXE files. either option is kind of gross.
If you really want Perl's powerful regex functionality, use the Regex++ engine for C++. It pretty awesome.
.
"URGENT" is so played out. But, hey, you're getting better... Your only other post here, from 5 months ago, was "HeLP I need it today"
next time, try titling your post "HALP HALP MY ASS IS ON FIRE!!!!!1" and lets see what happens.
.
Excel 2003 has both LOG() & LOG10(), why would the LOG() in spreadsheet be log10() in C?
because EXCEL is written mainly for people who don't really understand undergraduate-level mathematics, whereas C is designed for all sorts of folks, including engineers, scientists and mathematicians.
the natural logarithm, sometimes written as "ln", is the logarithm to the base e... all other logarithm bases are arbitrary, whether it's base 2, or base 10, or base 27.3 ... just because you have 10 fingers and think base 10 should always be implied, doesn't mean that's the case for the natural sciences, engineering, or even finance.
so C is universal in its application of logarithmic bases.
log(x) is the natural log of x.
log10(x) is the base 10 log of x
log2(x) is the base 2 log of x
if you want to use any other base, fine: use the simple property of logarithms to change the base to any arbitrary value b
logb(x) = log(x) / log(b)
.
yes, you're absolutely right Prabakar.
funny thing is, i looked at it and didnt even notice. I was thinking how such a conversion could be applied incorrectly -- like what happens when you try and make an EOF or CR or LF or NULL character "uppercase"
I suspect Nick was thinking of converting decimal values to ASCII, and had a late-night brainfart.
that's what i claim when i do stuff like that, anyhow.
.
yeah ... i'm just not seeing where the "Urgency" is here
i thought someone was bleeding on the floor.
well, it is good for that sort of work.
it's also my preferred tool, if only because (1) i already know the language and am familiar with it (2) it's just so easy to get something slapped together and actually working...
if i were just starting out, i might look into Python as an alternative, but I can't deny that Perl is a really powerful and easy-to-learn tool for exactly that kind of work.
on the one hand i probably complain too much. on the other hand, after a long day at work, i find this coding style with no whitespace, no indentions, no syntax, no nothing, to be unreadable in the most annoying way.
anyhow, sockaddr and sockaddr_in are two different structure types. try this: if (connect(sockfd,(struct sockaddr *)&serv_addr,sizeof(serv_addr)) < 0)
.
thats one of the most godawful implementations of a stack ive ever seen.
a stack is supposed to be simple:
PUSH and POP.
that's it.
.
HAY GUISE
there's a CHICK
with a NICE PUSSY
THIS HAS NEVER BEEN DONE BEFORE
HA HA, I'M ON TEH INTERWEBS!!!!1
PICs and 8051 derivatives are mainly programmed in assembly.
i dont mean to keep carrying this off into a tangent, but that's just plain not true
8051 derivatives have been being programmed in C as far back as 15 years ago, starting with the old Keil compiler. and thats just as far back as I remember.
sure, there are still sunday-afternoon hobbyists and students in poorly-funded classrooms who may program blinking-LED projects for their PIC's in assembly
but as far as industry goes... tons of embedded apps use PICs, 8051s and similar GP controllers in complex applications ... and it would be absolute *suicide* for any competitive company to try and program them in Assembly. you'd never get your product to market in any reasonable time, and maintenance would be cost-prohibitive
think about it, when a C compiler costs a few hundred dollars, what kind of business would be crazy enough to pay the manhours required for a staff of assembly coders?
look im not saying there arent any Assembly coders out there gainfully employed. but they're the exception, not the rule. the majority of assembly you see these days are short little macros, sparsely placed
for windows development, i use the Microsoft Visual C compiler. The "Express Edition" is completely free, and its the industry standard if you're developing PC apps. you can get previous versions (like 2005) if the 2008 doesnt work with your machine.
GCC would be the one for linux/unix
i mean, but hey, if you've got a project due, and you're allowed to use non-portable non-standard libraries like CONIO and BIOS... and you're used to workign with them, then dont change right now
just be aware, that these libraries will continue to haunt you and eat your soul until you exorcise them from your life.
as for my code, its working now just fine. and solves the Knight's Tour from any position on an 8x8 board in a few seconds .. would be a lot faster, but i display the board and moves to a terminal display, and that slows it down a lot.
but i can't just go and give it to you. that would defeat the point of you learning how to write your own code to solve problems.
all i did was use the old Warnsdorff's Algorithm. the algorithm itself is pretty simple, and has been around for some 200 years, to solve this exact problem.
.
yeah, because as we all know, Napoleon loved to make puns in English.
...
and hey challenging dude. apologies that we're not all just peeing our pants with delight over the prospect of taking your "challenge"
now here's a challenge for YOU. Locate the "search" button on this site. your challenging homework has only been discussed about 100 times
.
silly mortal, you doubt my powers?
watch me battle my way through pedantic digressions about the dangers of pseudo-randomness and the evils of scanf, while flying by the seat of my pants deep into the lair of non-error-checked command line input. all in the name of clarity i say!
whoops... here comes Naure
*ahem* now if you'll excuse me, i believe i have other um... threads to rescue.
another thing, "miles" needs to be initialized to zero before you start iteratively adding values into it.
just declaring it as a float does not initialize it.
are you using <TAB> in front of each command? i cant tell since youre not using code-tags.
dont "simplify" it until you get it to work in the first place. go back to the beginning and adhere strictly to your dependency graph
________ ________ ________
| ND.C | | PD.C | | MD.C |
======== ======== ========
|____ ____| |
| | |
__V__V__ ____V___
| PD.H | | MD.H |
======== ========
|
____V___
| RD.H |
========
what did this have to do with C?
okay, yes, that's all well and good but as you'll see there's a perfectly reasonable explanation as to why I ...
oh, look. the Queen!
If a train leaves the station @ 8:30 p.m. full of clowns named bob and larry and one named steve and it takes 1 hour to get there, the number of licks it will take to get to the center of a tootsie roll tootsie pop
= 42.
QED.
strtok will work to be sure, but you have to watch out that it will stomp all over your original string.
another way is to use pointers. make sure you can understand, and explain, how this works
void capitalizeFirsts(char *buf)
{
*buf=toupper(*buf); // first char CAP
while (*buf++ != '\0')
if (*buf == ' ') // look for space
*buf=toupper(*++buf); // CAP next char
}