- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 11
- Posts with Upvotes
- 7
- Upvoting Members
- 8
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
Re: No, never use scanf. Use fgets or even fread or read, and sscanf maybe. But then, the numbers conversion by sscanf is not specified in standard anyhow. And using %d, the sscanf does some strange things. %d must read int, but when we read into int and then print that … | |
Re: C wiki, with a lot of resources [url]http://www.iso-9899.info/wiki[/url] | |
Re: Indeed it seems that the only thing which standard says concerning the unary ++ and -- operators, is that the value of the operand would be obtained for use in expression, either before (postfix) or after (prefix) applying the operator. What remains unspecified is the order of evaluation of the … | |
Re: Yes vim has these features as well, it is indeed better to use programmers editor instead of ide. If you have makefile, why do you then need all these additional files which IDE makes, like project file, and that's often even not the only one. And all these additional features … | |
Re: So you want a somewhat dynamic array. For really dynamic array you should implement a linked list, which is not very difficult either, but you must be careful because mistakes in implementing it can easily cause a memory leak. But it depends, how are you going to use your array. … | |
Re: I don't know what this "opening a folder" exactly supposed to mean, but one thing which is usually always available, no matter what desktop you use, is xterm. This opens xterm in the directory /pathname/foldername and prints the directory contents: system ("xterm -e 'cd /pathname/foldername && ls && bash'"); Then … | |
Re: I want to say only that, use some more modern compiler than turbo c, like gcc (mingw or cygwin in windows). Turbo c is an extinct compiler, somewhat hopelessly outdated, and you cannot find libraries for it etc. Otherwise, using conio is perfectly ok, there is conio for windows, and … | |
Re: Thank you, good algorithm! The same using GTK, which shows that it's not very difficult to port simple graphics to another graphics library, i don't know though whether i guessed the colors right. [code] #include <gtk/gtk.h> #include <stdlib.h> int diskisin [5], posinpeg [5], diskcount [3], width = 655, height = … | |
Re: Disgusting, i'm for all programmers to get paid for what their work is worth, not playing with them by taking job from programmers somewhere and giving it to programmers somewhere else. And concerning your government supported IT companies led by communists, i would advise not to have any deal with … | |
You likely want something graphical, where the things move. GTK version of the classic arcade game Asteroids. | |
A small demo about how to use GTK label as a simple console. To compile GTK program, `pkg-config gtk+-2.0 --cflags --libs` should finally be somewhere in the compiler command line in the bash-like shell. | |
Replaces every occasion of the pattern, or only the first occasion if there is a subexpression, between \( and \), anywhere in the regular expression, as repeated replace is not what one would expect in that case. The string size is restricted in POSIX regular expressions to the size of … | |
Re: Thank you for putting up this, it's nice, and certainly much more advanced than mine, though I just wanted to provide a minimal kit which enables to edit files. I have a few questions though, not necessarily about your code, but about such things in general, my code is not … | |
A very rudimentary more, press enter to view next screenful of text, like with print command in ed text editor. | |
Similar to cat in unix textutils. You can actually edit files with these. Remember that ctrl-z sends end-of-file in windows, and ctrl-d in linux. | |
Text fragment extractor (usage: fragment /pattern/[n] [/pattern/[n]] file), similar to the print command in ed and vi, with pattern range. If the second pattern is omitted, prints to the end of file. Use quotation marks when there are spaces in the argument. Finds the first pattern, then the second pattern, … | |
Re: Yes it sounds complicated, and any stdafx.h is not a standard c header, either. What is GPP? If you mean gcc, then why it's complicated? Use command line, gcc something.c -o something.exe (in mingw and cygwin) is all you need to compile a standard c program, nothing can be any … | |
Re: Ancient Dragon is right what concerns scanf. I thus say that in the capacity of the right shouter, like in a meeting someone shouting "that's right", may significantly increase the credibility of the statement made by some other person. Additionally, scanf is a proper function only on condition that no … | |
Re: What is the end condition in your for statement? There, your i is 10, you iterate up to the value of some element of your array, which is bigger than the array size. You go beyond the limit of the array, which may cause any kind of unexpected behavior. But, … | |
Re: I included stdlib.h, and my compiler doesn't give any warning, even with all warnings on. Without stdlib h it says "incompatible implicit declaration of built-in function 'malloc'" gcc 4.1.2, debian linux. | |
Re: I think you are good people, i indeed believe that you are good people, and therefore it's natural that you want to believe that world is good, with occasional few bad guys somewhere. | |
I was banned from DaniWeb IRC after jtwenting saying to me that if i were in gulag, i didn't last five minutes when i didn't lick the shoes of the party apparatchic, and after i dared to say anything to defend myself, what i said was only that whether he … | |
Re: I don't know the borland c graphics api and don't recommend to use it, as it's just a commercial library, not standard, not open source and not cross-platform, not very good either. No one agrees with gtk seemingly, but then at least use opengl, or even sdl. But why the … | |
Re: I only wanted to say, that i don't want to read Narue's posts, as i'm a victim of serious violence by him/her, with which he maybe made it impossible for me to continue here. Just please remember that someone else may be next. | |
Re: Well it's getchar but getchar is not exactly equivalent to the getche in borland c... By default, the standard input in c is in the canonical mode, which means that all input is line buffered and the line would be received only after the linefeed. This means that no matter … | |
Re: Well we would not start to teach you mathematics here, finally this is a programming forum, you may ask these questions in some mathematics or physics forum. But in short, there are other ways to calculate x^y than to multiply x y times, which is even not possible when y … | |
Re: I may help if i knew how far you actually are. It is not very difficult to write a simple text editor from scratch, first you likely have to implement a doubly linked list of pointers to lines, at least this is how it is implemented in many text editors. … | |
Re: Yes, Salem is right, %c gives you a character with a corresponding code, not a number, 1 1 0 1 0 1 1 1 is exactly what your program outputs when you use %d. Also, when you initialize the arrays, you don't always have to provide the size, like in … | |
Re: Load shared library, and call a function in it. Don't use debugger, instead add debug statements to the code, it's much more efficient and faster that way. | |
Re: I don't know, maybe it's c++, like there are every kind of weird << and >> in cout... But at least it's not c. Following the typedef identifier should be a declaration, which mostly starts with a type, not with map> something... With typedef you define type, you can use … |