1,265 Posted Topics
Re: umm, so then what's wrong with [ICODE]char map[10][10];[/ICODE] ? | |
Re: you want to extract part of a string from within a string. the fact that this string is in a linked list is irrelevant. ask yourself the same question, but generalized: "[I]How do i pick part of the data from the [B]string[/B]? [/I]" example: [ICODE]strncpy(&origString[10], subString, 5);[/ICODE] will get bytes … | |
Re: the problem is you've got that "return" statement right near the end of the "else if (i==4)" block. if you've returned from the function, neither "bzero" nor "fclose" will be called. this is the danger of putting returns in odd places. unless you have a real reason not to, like … | |
Re: [quote]y u cant show ur effort a little here plz????? [/quote] how about YOU show a little effort, and keep your mess in one thread. | |
Re: [QUOTE=Muhammadlodhi;1189386]I need your help AT ONCE plz IN C CODE ONLY ... NOW write equation like this [/QUOTE] yeah, i'm gonna suggest that you rethink how you phrase requests. I dont know about your native language, but in English language when you are requesting for someone to help you, and … | |
Re: sorry, your question is not urgent. and the fact that you have spammed it here multiple time, now just moved you to the very back of the queue. | |
Re: something's not right, here. how are you gonna neuter a cat named "Betty" ? :S | |
Re: [QUOTE=riahc3;1187009]I personally wanted to use getch and getche[/QUOTE] forget getch and getche ever existed. the need for unbuffered terminal input has become obviated since the widespread adoption of GUIs, like, about 15 to 20 years ago. or dont, and hobble yourself with reliance on non-standard, non-portable library functions that will … | |
Re: you're gonna have to give us some more to work with here. lets see this window that you created using C. post the code. preferrably you will use code tags and post code that compiles. | |
Re: i'm having a hard time following your question... what exactly are you trying to do? one thing you should know that will help you, is you don't need to cast each char as an int just to do a comparison to a constant value. a char type is essentially just … | |
Re: sorry for the simplistic question, but have you tried to resize your screen resolution? | |
Re: [quote=nathandavies;1183081]hi....everyone i am new here and welcome daniweb forums....[/quote] great! Welcome! Im glad youre here! Because we need more people to bump 6 year old threads to promote their spammy sig links! :) :) :) :) | |
Re: i, too, hate the geico commercials. it's stale and unfunny and plain annoying. the radio spots, at least. i don't watch tv. | |
Re: what Banfa said about your character array's size and the number of characters read by fgets() must match. but you don't necessarily have to allocate your "numbers" array dynamically. you can, for simplicity's sake, just declare it to be some arbitrarily large size. [code]double numbers[100];[/code] since these are "doubles" (double … | |
Re: [QUOTE=vino4all;1184945]I need to have an equilateral Triangle shape in the output.[/QUOTE] hold on, your example triangle you posted, with spaces replacing the dashes, you said you wanted it to look like this:[code] 1 12 345 6789[/code]this example is not an equilateral triangle. [I][B]it's a right triangle[/B][/I], that is right-justified, whereas … | |
Re: these are warnings, not errors. meaning your program will compile and run (for a while), but probably will not work as expected because you're doing something unusual. first one is you're assigning an int (length) to the char array (input_buffer). before we can fix it, we've got to know what … | |
Re: life is hard, but we're here to help. [url]http://lmgtfy.com/?q=glut[/url] | |
Re: look, heres a quick-and-dirty way to get an integer from input, using fgets(). [code] char buffer[32]; int number; do { printf("enter integer : "); fflush(stdout); // needed because no newline char fgets(buffer, sizeof(buffer), stdin); // get string input number = atoi(buffer); // converts integer found in string if (number == … | |
Re: sorry you're having so much trouble. i'm afraid i have no idea about converting old borland graphics libraries. i avoid ever using them in the first place. at leas this can serve as a warning to others, to stay clear of developing on Turbo C, especially with the antiquated graphics … | |
Re: changing color of text is not a C-language function. if the Intel Compiler has this capability, it is a "compiler extension". you will have to find the documentation for the compiler and research how this is accomplished. be advised that any solution you find will not be portable, and will … | |
Re: [icode] gcc -lpthread -o dining dining.c[/icode] works for me ;) | |
Re: this is C++ code, so it's not going to work on a C compiler. You may already be aware of this, but I'm just sayin' | |
Re: dont use [B]float[/B] do use [B]double[/B] if you want to round up to the next single unit (one's place), then just add 1.0 and recast it as an int to drop the fractional parts. if you want to round up at a certain decimal place, then first multiply by a … | |
Re: [ICODE]for (;;)[/ICODE] just means "forever". typically used for a loop that will execute an indeterminate number of times, exiting with a [ICODE]break;[/ICODE] command once the exit condition is found. the corresponding while would be [ICODE]while(1)[/ICODE] or [ICODE]while(TRUE)[/ICODE]... doesnt make any sense to use '\n', even though technically '\n' is non-zero … | |
Re: please check the dates before posting. youre responding to someone who posted over two years ago, who was posting to someone else from four years prior to that. nobody cares about this thread or is paying attention, all its doing now is cluttering forum space and wasting time. | |
Re: I shall never think of it either. And let us never speak of it again. | |
Re: hi, and welcome. your english is great! just from your intro, you could have passed for a native speaker. anyhow, don't worry about it, there are a lot of international people here, and very many of them have difficulties with english. it's not a requirement that you be fluent, just … | |
Re: welcome! go to C++ forums and take a shot. be glad to have you :) | |
Re: [QUOTE=Ancient Dragon;1185228]Line 22: is that the one with perror()? I don't see anything wrong with it.[/QUOTE] reading the context of the error, you can see that line 22 on his side doesn't match up with line 22 as they are numbered here. his line 22, the one with the error, … | |
Re: you can copy any file, whatever the type or extension. just open the source file as a binary file and use a while loop to copy each byte one at a time to the destination, until the EOF charater is found. see [URL="http://www.cplusplus.com/reference/clibrary/cstdio/fopen"]fopen()[/URL],[URL="http://www.cplusplus.com/reference/clibrary/cstdio/fgetc"] fgetc()[/URL], [URL="http://www.cplusplus.com/reference/clibrary/cstdio/fputc"]fputc()[/URL], and[URL="http://www.cplusplus.com/reference/clibrary/cstdio/feof"] feof()[/URL] in the standard … | |
Re: using the libcurl library is independent of whether or not you use the MinGW compiler. it's a library, you compile it to be used on your system. the library is then invoked to build an executable that can be distributed to any machine running a similar OS. you should focus … | |
Re: that wont solve most of it. most thread hijacking occurs in current threads. And while this is annoying, it is easy to deal with. simply tell them to make their own thread and ignore them afterwards. the issue self resolves. what's more of a problem is how every other dipshit … | |
gcc supports an extended precison "long double" type typically 10 or 12 bytes but Windows XP always maps the "long double" to the standard double (typically 8 bytes) MinGW on windows XP thinks it has a 12-byte "long double" but in fact it only has the 8 byte support on … | |
Re: this doesnt work. try to find primes from 2 to 30: [code=text]2 30 3 5 7 9 11 13 15 17 19 21 23 25 27 29 Process returned 0 (0x0) execution time : 5.015 s Press any key to continue.[/code] | |
Re: this thread made me laugh. and, no. i haven't. take A.D.s advice :P | |
Re: use fgets to read from the first file use fprintf or fputs to write to the second file. here's the most basic example. error checking and user input not included. [CODE]readhandle = fopen(readfilename,"r") writehandle = fopen(writefilename,"w") while ( fgets(readbuffer, MAX_LINE_LENGTH, readhandle) != NULL ) fprintf(writehandle, "%d %s", strlen(readbuffer), readbuffer); fclose(readhandle); … | |
Re: all computer arithmetic is binary. base 10 output is but an illusion. desire only leads to suffering. you must transcend it if you are to become boddhisattva. . | |
| |
Re: sounds like you should go for a 2-year certificate program or AAS degree rather than a BS, since you seem more of a hands-on guy who wants to get busy right away. the entrepreneurial aspects of what you want to do aren't going to be helped by a 4 year … | |
Re: just go to a used computer parts and accessories store near you and buy an old ZIP drive.. remember the Iomega ZIP drives from the late 90s? you can still get them, and drivers are available for both Win98 and WinXP use it to transfer all your important files from … | |
Re: [QUOTE=deeep;1182686]Create the header file func.n and include all the function declarations in this file. In the other C file, use extern followed by the name of the function.[/QUOTE] no, that is entirely incorrect. please do not post wrong answers after someone has already correctly answered the question. jgehlot, what Walt … | |
Re: use fgets to read the source file one line at a time. this will take a small character array of some arbitrary length. say 80 or 120 characters. you could do it a lot smaller, but i don't see any reason why you would want to.. use fprintf to write … | |
Re: thread hijack. this thread is a year old. read the rules. make your own thread. use code tags. | |
Re: hey, didn't we just have this conversation over in C, like, a day ago? [quote]basically it's three simple things: -- post your code when you want specific help. -- use [code] tags so we can read your code. -- don't hijack other people's threads.[/quote] bumping a 2 year old thread … | |
Re: ncurses is the unix counterpart to DOS's conio. they both originated in the early 1980's. I beleive conio was basically a windows port of pcurses. they both are largely obsolete. ncurses does not do graphics any more than conio does. use GTK+ or OpenGL libraries for graphics. | |
Re: yes, C is full chock full of time functions. just check out the standard [URL="http://www.opengroup.org/onlinepubs/007908799/xsh/time.h.html"]<time.h>[/URL] library | |
Re: yes, use fgets. it gets the whole line up to the newline character or the maximum number of characters argument. fscanf, as you have it written, will get up to the first whitespace. if there's any chance of whitespace variance of your files, you will have to do more complex … |
The End.