No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
57 Posted Topics
Re: I find this amusing, especially after looking at his signature. -Fredric | |
Re: Woah woah woah. What's so illegal with 'i=i++'? Wouldn't it just try to increment i, and then set i equal to the original value of i, making the ++ do effectively nothing? That's what it does when I try it, but I don't have a straight C compiler handy.. -Fredric | |
Re: Like the error message makes perfectly clear, the variable is not defined anywhere before that call. Are you trying to send over the attachment's filename? Judging from your code, isn't that being stored in $name? -Fredric ![]() | |
Re: Well, one thing that you could do is to take away the couts and use printfs... Use fopen, fprintf, and fscanf instead of the std fstream stuff. Make sure all of your variables for functions are defined at the start of the function (if you have a horrible C teacher … | |
Re: All day. I have a laptop with me at all times, and unless I'm walking somewhere or possibly showering (though that is hardly on a daily basis) I am usually either programming, browsing the Internet, or doing something else that is computer related. In fact, my laptop is usually with … | |
Re: [QUOTE=Ancient Dragon]3)how can we delete duplicate elements in an array with o(n) time complexity?(i want the code or algorithm)[/QUOTE] Easy. Go to the spot in the array where you want to delete the element. Copy the next element in the array to that spot, move to the next element. Repeat … | |
Re: [QUOTE=namit]I have writen a scipts in linux its called user.sh i wounder how do i run it in a php script I can if i just run it in command line ./user.sh it works perfect but can i add it into my code. thanks[/QUOTE] You sure can do that. Assuming … | |
Re: There are more than likely server configurations that are preventing you from accessing the file in ~/functions/. This is primarily due to security issues. Also, you probably should specify which user's home directory you want to go from (i.e. ~johndoe/functions/). -Fredric | |
Re: [QUOTE=nisaa15]Well I want to start the search from the root node. How can I represent the edges that the node has? once the computer knows if the edge exists if will follow this edge through to it destination node. My problem is - how do I represent the edges one … | |
Re: [url]http://www.ncsa.uiuc.edu/VR/VR/[/url] I've taken a few classes in developing virtual reality programs. We used the facilities posted above. I wrote code with primarily CaveGL (very similar to OpenGL), using c++. These sort of facilities are fun, but they're pretty useless currently. It is kind of sad. Check out this guy too: … | |
Re: [QUOTE=comwizz]I am having this problem to define a function which raises a float y eg 3.5 which is not a whole number to the base x. Heres the code which gives domain error as function pow takes only int values.[/QUOTE] [url]http://www.cplusplus.com/ref/cmath/pow.html[/url] Pow, in the standard C library for mathematical operations, … | |
Re: You can check out CFile, if you want to stick with the MFC stuff and not mess with STL or the C file input/output functions. For CFile: [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_MFC_CFile.asp[/url] As for how to write a string to a file using STL, you should be using the GetBuffer() and GetLength() methods of … | |
Re: [QUOTE=server_crash]Do you mean a tree? ;) I'd say use a map or something along those lines. If there's a java equivalent of the c++ multimap, then go that route.[/QUOTE] There is. Here's a handy little link: [url]http://java.sun.com/j2se/1.4.2/docs/api/java/util/Map.html[/url] | |
Re: [QUOTE=ashneet]I made this function and the problem i have is that the Variavle $Time is not available to the whole program and what i mean by that is the function runs but doesn't set the variable to the whole thing and i have tested the function by doing echos. Is … | |
This is a very sensitive subject for me, however I am looking for opinions from the tech community on it.. This past year has been screwing me left and right financially. I'll let you all in on what has happened: A year ago, I caught 2 of my landlord's employees … | |
Re: [QUOTE=Asif_NSU]I wanted to explore and know about the GUI toolkits available to be used with C or C++. I heard a bit about Qt, GTK, Mingw etc, and there's MFC too. For the moment I am not quite sure which one to start with. Does a programmer need to know … | |
Re: [QUOTE=namit]How do i use this str_replace with this [email]bla@bla.com[/email] [email]blac@bla.com[/email] [email]namit@namit.com[/email] and so on so i have setup $email = str_replace(" ", ", ", $mail_list); but it will only talk details if i do this [email]blac@bla.com[/email] [email]bla@bla.com[/email] It does not seam to find and replace return[/QUOTE] The 'return' character is … | |
Re: Why not use a constant pointer to the vector? If the vector is not zero, then make a copy of it inside the function. [CODE] string whateverTwo( int a, const vector<string> *defaultV = 0) { vector<string> stringVector; if (defaultV != 0) stringVector = *defaultV; // ... } [/CODE] | |
Re: Probably the '.txt' that you are reading is an ASCII file. .jpg and (I think) .doc are binary files. The difference is that ASCII files generally store readable text data, and binary files generally contain non-text data. -Fredric | |
Re: [url]http://www.daniweb.com/techtalkforums/thread19956.html[/url] | |
Re: [QUOTE=extofer]You can read about my linux experience here: [url]http://www.gabrielvilla.com/forum/?p=9[/url] and my question is about Gentoo. I decided to install Gentoo, but after printing pages of the installation guide, I could not get too far. Two things??? is there a ditro as good as gentoo (not red hat or mandrake or … | |
Re: [CODE]public class b { public static void main(String args[]) { a w = new a(); a.prt(); }[/CODE] You're trying to call prt() as a static method of a, which it is not. Shouldn't that be w.prt()? -Fredric | |
Re: [QUOTE=Puckdropper] sSaverPtr -> data = filled; Using a struct to form a linked list.[/QUOTE] I think he meant doing something like: [CODE] *sSaverPtr = filled; [/CODE] Which dereferences whatever sSaverPtr points to, and changes the stored value there to filled. -Fredric | |
Re: Well, if you don't know what is wrong with it, you can't expect anyone else to know what is wrong with it. What problem is it giving you, specifically? It compiles and runs just fine for me, and it even seems to be able to find keys. -Fredric | |
Re: [QUOTE]Can anyone explain me what does $this->connection mean another words what does $this really do and how it works. [/QUOTE] In PHP, as with most object oriented languages, $this is a reference variable that allows access to members variables of the class $this is used in. For example: [PHP] class … | |
Re: I don't quite understand what it is you're doing here: [CODE] void insert(int array[]) { int value; int *frontPtr = array; // referenced both pointers to first element into the array int *rearPtr = array; // ... if(((*frontPtr == 0) && (*rearPtr == MAXSIZE)) || (*frontPtr == (*rearPtr + 1))) … | |
Re: Well, try all numbers from D to 1,000,000. I was able to write a program that calculates this in under 20 seconds. BestPi: 3.141592653588651 3126535/995207 I used one loop that went from D equals 1 to 1,000,000, the interior loop is where it gets tricky. Like you said, the ratio … | |
Re: I managed to get your code to compile and run, but I had to kill it after clicking twice. After looking at your code I noticed that you were trying to draw in the glut mouse function, that's a bad idea. There is a reason why you have a draw … | |
Re: I think you know how to take a factorial of a number, but your variable usage is not good. [CODE] while ( z != 0) { result *= z; z--; } [/CODE] Now, honestly, that works if you first set z to the value of whatever you want to take … | |
Re: [CODE] int i = 5; // Or number in the ascii table. System.out.format("%c ", (char)i); [/CODE] [url]http://www.lookuptables.com/[/url] Is that what you mean by special characters? -Fredric | |
Re: A final class? You mean like a final variable in Java? I haven't heard of that before in C++. But to answer your question about making private constructors, the only reason why I could see you doing something like that would be in this case: [CODE] class Something { private: … | |
Re: Isn't std::string the ANSI string? Why are you not using std::string? If you were you could just do... [CODE]result.erase(result.find(' '));[/CODE] To remove one space... -Fredric | |
Re: [CODE] #include <iostream> using namespace std; int main() { int i, j, lines; cout << "This Program creates Christmas Trees." << endl; do { cout << "Please enter a number between 1 and 30" << endl; cin >> lines; }while (lines < 1 || lines > 30); for(j=0; j<lines; j++) … | |
I happen to be writing a very simple text browser, and I'm having a problem connecting to servers using HTTP1.1 GET messages... HTTP1.0 works fine, I just have a string like this: [CODE] const char *request = "GET / HTTP/1.0\n\n"; [/CODE] This works great, and I receive my html back … | |
![]() | Re: The color schemes (note the plural) and the banners make me wonder what I'm looking at... Other than that the content and people are there. :-P -Fredric |
Re: Just store the sum totals in an 11-element array of ints. (there are 11 possible combinations for the sum of two 6-sided dice) [CODE] int num[11]; for (int i=0; i<36000; i++) { // ...Calculate the two die rolls randomly.. num[die1 + die2 - 2]++; } [/CODE] That should get you … | |
Re: I'm kind of confused as to what the ' character is too... Are you sure it isn't one of the logical AND or NOT characters? Did you copy the problem down right? [url]http://en.wikipedia.org/wiki/Boolean_algebra[/url] -Fredric | |
Re: Our town has a lot of squirrels, but it would be unheard of to shoot one (and would probably get you jailed), let alone eat it. Now, I have a friend who goes to college a few hours South of where I live. I went down there to visit him … | |
Re: [QUOTE]I played GTA for like an hour and thought it was a boring game and never played it again.[/QUOTE] I can think of three different visuals while playing that game.. The first is driving around a city, the second is walking around a city, and the third is having your … | |
Re: [CODE] test.insert(pair<int,int>(a,b)); [/CODE] That works for me..? -Fredric | |
Re: The first one is obviously a geometric series, google is your friend if you haven't had that level of math yet. Don't mess with the second one. n! is O(n!), and it is also O(n^n) (but not Big-Theta of n^n). -Fredric | |
Re: [CODE] node* p_before = find_element(number, k_beginning); [/CODE] What is k_beginning? Is it a node? Is it a number? Is it suppose to be p_beginning? In any case, that code shouldn't truncate the end of the list. But it still looks like bad code, what happens when you try to add … | |
Re: I've heard of problems with MSVC++ 6.0, where everything runs fine when you're just running it from MSVC, but when you go to run it in its release/debug folder it crashes. If the program was a missing dll then an error message should pop up when you try to run … | |
Re: [url]http://hjs.geol.uib.no/cplusplus/[/url] Looks like a good place to start. -Fredric | |
Re: When you volunteer to sign up for the military you should accept the risks and understand that it isn't some picnicing free ride through college. This mother thinks that her son's life was wasted, but she has already spoken with Bush and was unable to get through to him. Now … | |
Hello everyone! I figured I would introduce myself here, where all the other new comers seem to have posted...I hope my making of a new thread for this isn't annoying to anyone. I ran into this site while looking for some answers to a few Java questions I had this … | |
Re: [CODE] ... bool CheckDate( int day1, int month1) { int day1, month1 = 0; ... [/CODE] Two things I see wrong there. First, if you want CheckDate to be a method of class dateReport then you need to add dateReport:: before the method name, like... [CODE] ... bool dateReport::CheckDate( int … | |
I saw an example function for some unknown algorithm in a book that was explaining big theta/o/omega notation. I understand how it all works, but this example is throwing me off: f(n) = 3n^2-2n-10 And what I'm wondering is this: What kind of operation could you possibly do that would … | |
Re: :rolleyes: You must be in the most difficult beginning programming class imagineable. |
The End.