1,265 Posted Topics

Member Avatar for fruitkiwi

first function depends on second. caller is responsible for error-checking input into "convert( )" example : value = convert("mcmlxix"); returns: value = 1969 [code=c] int convert(char *roman) { int arabic = 0, tmp; char *str_p = roman; while(*str_p) { tmp = letterValue(*str_p); if (letterValue(*++str_p) > tmp) arabic -= tmp; else …

Member Avatar for jephthah
0
191
Member Avatar for fruitkiwi

insert your properly-indented code between code tags [ code=c ] insert code here [ /code ] (except, do not have any spaces within tag brackets... i just put those there so it wouldn't actually turn it into "code" ...)

Member Avatar for jephthah
0
159
Member Avatar for jephthah

okay, experts, i need help. i can't seem to replace characters in a file, like i thought i would be able to: here's an example code. i put print and error stuff in there to try and debug. everything seems to be working ... except that my filename is not …

Member Avatar for jephthah
0
285
Member Avatar for soosai

man, you're gonna have to come off with a better description than that. lets see your code, and we'll go from there.

Member Avatar for jephthah
0
81
Member Avatar for Drake
Member Avatar for coolerfantasy

just be careful you dont let the smoke out of your video card. that stuff's hard to put back in.

Member Avatar for Narue
0
153
Member Avatar for pete212

[code=c] #include <stdio.h> main() { int value; printf("enter any decimal value: "); scanf("%d",&value); printf("value: decimal %d = hex %x\n", value, value); return 0; }[/code] thats all you have to do, right? "int" doesnt have an inherent base. it's whatever you want it to be, whenever you want it to be. …

Member Avatar for WaltP
0
150
Member Avatar for davidianstyle

you could consider using \W+ instead of \/ and \: \W+ is any amount of non-alphanumerics. as opposed to \w+ which is any amount of alphanumerics (ie, 'A-Z' plus 'a-z' plus '0-9' plus '_' ) that way you wont be locked into certain exact type and amount of separators between …

Member Avatar for jephthah
0
77
Member Avatar for j.arevathi

Bio Perl... that looks like some pretty cool stuff now i have a new diversion to poke around in :)

Member Avatar for jephthah
0
139
Member Avatar for one1082

Thank the gods. Someone finally answered this question that we've all been struggling with this for 4 1/2 long years, what a relief. someone let Tim know he can mark this as "solved"

Member Avatar for jephthah
0
129
Member Avatar for vardhani

there's no such thing as a random number. num = rand(); will return a [b]"pseudo-random"[/b] number over the interval between 0 and 2^32, depending on your compiler. not truly random, but i suspect that it will have enough "appearance" of being random for your purposes.

Member Avatar for jephthah
0
132
Member Avatar for modaslam

why the f would anyone think this is a reasonable question for a programming class? no wonder so many people come out of CSC 101 or whatever hating programming, and not knowing how to do a damn thing.

Member Avatar for Narue
0
133
Member Avatar for Nessie
Member Avatar for ihavegotnewsox

friends don't let friends use AOL not because of hacking. just because

Member Avatar for jephthah
-1
368
Member Avatar for soosai

maybe these people are all from countries that blacklist Google's IPs just wondering.

Member Avatar for jephthah
0
94
Member Avatar for g_loughnan

just because you include the header file doesn't mean you're getting the code. the errors you described earlier sound like you're not linking properly. the solution depends on your compiler, and how their source code is provided... whether it's in a .dll or a .lib or whatever

Member Avatar for g_loughnan
0
137
Member Avatar for mank
Member Avatar for kpnprakash

uh, did you try this? [code] C:\> copy file.txt C:\path\to\new\place\ C:\> cd C:\path\to\new\place C:\path\to\new\place> type file.txt [/code]

Member Avatar for WaltP
0
74
Member Avatar for Majestics

solutions involve using either #include <conio.h> or #include <windows.h> neither of which are portable. for Linux/Solaris, you would use the #include <ncurses.h> library [url]http://www.blurtit.com/q616731.html[/url] [url]http://www.daniweb.com/forums/thread34554.html[/url] [url]http://www.unix.com/high-level-programming/33023-blinking-text.html[/url]

Member Avatar for arpit_yadav
0
143
Member Avatar for knight fyre

at least some of your problem may be due to fgets( ) retains the newline character. but im not sure how some of the other stuff you're doing would work... anyhow, I think you'll find it's best to try to keep code basic and readable for the next guy, rather …

Member Avatar for jephthah
0
128
Member Avatar for Tom21

well... the first 5 lines are okay... on line 5 you fget the first line of the file and put it into the string "line"... that's fine too but then on line 7, you start checking the string "readline" where does this come from? you should be checking the string …

Member Avatar for jonnelgrande
0
75
Member Avatar for geska10

[quote]can some one make this before 19 march 2008. it is my homework [/quote] LOL you kids, i swear how about you send me $500 to my PayPal account and I'll won't track your IP address and tell your teacher what you're up to..

Member Avatar for mitrmkar
0
86
Member Avatar for bops

how about you take a stab at it, and when it doesnt work you post what you did here, then we can look and see where the error(s) might be.

Member Avatar for bops
0
185
Member Avatar for hafhag

your post is the surest way to not get any help here. if you want help, here are the steps you must follow: (1) write part of your program (2) when it doesn't work, post your code and specific questions here

Member Avatar for jephthah
0
69
Member Avatar for majestic0431

[QUOTE=arpit_yadav;564312]I have seen your problem & itry to solv it out .[/quote] i seriously doubt that. [quote]please help me to rite a sample TSR[/QUOTE] how about if i sign your address up with every contact on the ROKSO blacklist, just for being a rude thread hijacker. start your own thread. …

Member Avatar for jephthah
0
196
Member Avatar for Ryano24

at the very least, you have to have an equal number of open parentheses and close parentheses '(' and ')' in any given statement. and if youre going to have a conditional after "else", then it needs to be "else if" ... which then presumes another statement to follow for …

Member Avatar for jephthah
0
2K
Member Avatar for severman
Member Avatar for -genESIS-

for the love of all that is good and holy, please remove those foul GOTO statements. the answer is easy enough, but i cant even bear to look at this code as long as there's a GOTO in there.

Member Avatar for jephthah
0
111
Member Avatar for ghaith

change it to this: [code] server_addr.sin_family = AF_INET; server_addr.sin_addr.s_addr = inet_aton(IP); server_addr.sin_port = htons(PORT); [/code]

Member Avatar for jephthah
0
236
Member Avatar for severman

[QUOTE=severman;563077]ive tried and tried and still nothing. i just dont get it. how do i copy the line in my struct and copy it as a string...[/QUOTE] okay, here's your structure [code=c]# typedef struct { int id; char full_name[LEN]; struct { unsigned sem_a; unsigned sem_b; }grades; }Student; [/code] so you …

Member Avatar for jephthah
0
170
Member Avatar for chts12345

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.

Member Avatar for jephthah
0
138
Member Avatar for severman

wow. now THAT was one helluva gift, serverdude. you don't even know.

Member Avatar for jephthah
0
103
Member Avatar for hhheng

[QUOTE]Currently I'm working like this: gtsee.com/cgi-bin... [/QUOTE] whoa, for a sec i thought you were pointing us to the goatse dude :O

Member Avatar for jephthah
0
127
Member Avatar for wonder_laptop

[QUOTE]so the same commands will work on both linux and windows ?[/QUOTE] rarely, if ever, does windows and linux have the same commands for anything. for compiling C on windows, you might typically use the MSVC compiler distributed for free from Microsoft, either as a standalone or as part of …

Member Avatar for jephthah
0
95
Member Avatar for gsivaram
Member Avatar for a.suryakumar

I would try to help you but your code is unreadable. You need to use the "code" tags and include your indentations as described in the posting rules. also, you need to explain what you have already done as far as debugging. like Kevin said, this is not a service …

Member Avatar for jephthah
0
83
Member Avatar for Gerritt

you can make it a function: [code=c] void strToUppercase(char * myString) { while(*myString) *myString = toupper(*myString++) } [/code] or perhaps a more "easy to understand" bit of inline code: [code=c] char myString[128]; strcpy(myString,"the quick brown fox jumped over the lazy dogs"); for(a = 0; a<strlen(myString); a++) { if (myString[a] >= …

Member Avatar for jephthah
0
92
Member Avatar for wollacott

never use conio.h for anything. that just breaks your program for anythign other than windows. and never,.ever, ever use "GOTO" statements. and by that i mean never. they're absolutely horrid. use a while or for loop instead.

Member Avatar for jephthah
0
94
Member Avatar for williamthelast

giving new programmers "malloc" is like giving them rope to hang themselves with or a gun to shoot themselves in the foot with. even experienced programmers should avoid the use of malloc unless absolutely necessary. which it usually isn't. declare the local "tmp" string in the subroutine as a char …

Member Avatar for jephthah
0
112
Member Avatar for nelledawg

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 [code=c] void capitalizeFirsts(char *buf) { *buf=toupper(*buf); // first char CAP while (*buf++ != …

Member Avatar for jephthah
0
106
Member Avatar for os.hacker64

[QUOTE=os.hacker64;560244]How does gcc order bitfields on a little-endian machine? Is the first entry the most significant bit or what?[/QUOTE] endianness referrs to byte ordering, not bits. bit ordering is always the same. endianness describes the direction that bytes are stored in increasing memory locations. big-endian means "big end first". little-endian …

Member Avatar for jephthah
0
99
Member Avatar for wollacott

this is a tough problem. i actually tried to do this last night, and i could not get it to work right. getch() from the <curses.h> library, did not work as advertised for me. and im using the gcc compiler. obviously the getchar( ) function requires an <ENTER> before reading …

Member Avatar for jephthah
0
268
Member Avatar for mathmagic

printf, as narue said, is able to format quite well. [code=c] sumValue = firstValue + secondValue; printf(" 0x%04X\n", firstValue); printf("+ 0x%04X\n", secondValue); printf(" --------\n"); printf(" 0x%04X\n", sumValue); [/code] i think we can just this one away for free.

Member Avatar for jephthah
0
6K
Member Avatar for Crushyerbones

compile the following program, run it, and print the results back here [code=c] #include <stdio.h> int main() { printf("sizeof(char) == %d\n", sizeof(char)); printf("sizeof(short) == %d\n", sizeof(short)); printf("sizeof(int) == %d\n", sizeof(int)); printf("sizeof(long) == %d\n", sizeof(long)); printf("sizeof(long long) == %d\n", sizeof(long long)); return 0; } [/code] this will show you that 12! …

Member Avatar for Crushyerbones
0
242
Member Avatar for KimJack

"I created a text box ..."' you created a GUI and you're trying to get the input to a file handle?

Member Avatar for KevinADC
0
67
Member Avatar for newport

god forbid someone ask a legitimate question here without getting told to RTFM. i see now how Walt has so many 'solved' threads. one problem is youre putting your filenames in quotes. otherwise, its pretty simple, just use "fopen" and "fgets" in a this manner. [code=c] printf("enter filename: "); fgets(filename, …

Member Avatar for jephthah
0
110
Member Avatar for spec80

spec80, ignore walt. He's apparently got some hostility issues with people who have honest questions. nice quality for a moderator. anyhow, don't panic. you're 99% done. instead of locally calling "rootone" and "roottwo" inside your subroutine, use the global variables that you already declared outside of main() ... "root1" and …

Member Avatar for jephthah
0
173
Member Avatar for dokumen

youre crazy if you think anyone is going to try and read that mess. you need to formulate some kind of a coherent question about what you're trying to do with this guy's code.

Member Avatar for jephthah
0
156
Member Avatar for baliw53

[U]heres how this works:[/U] FIRST, you write your program, or at least part of your program. THEN, when it doesn't work, you come here and ask why doesn't such-and-such work, and show what you were trying to do. FINALLY, we will show you how to fix it and make it …

Member Avatar for baliw53
0
96
Member Avatar for nishanthaMe

well, i'm sure glad you told us it was for "academic purposes". i was getting ready to call Chris Hansen

Member Avatar for jephthah
0
71

The End.