342 Posted Topics
Re: It's not clear to me what kind of "evaulation" you need to do. Is it looking at each charactor for alpha, numeric, punctuation or spaces or what? The other problem is we don't know what you are "allowed to use". For example, there are lots of possibilities in <string> and … | |
Here is a snippet from an example on C++.com. They use what looks like a do loop. I tried putting it into their search, but nothing came back for "do". As far as I can tell it forces the loop intially, otherwise the while statement would cause it drop through … | |
Re: IF your intent is to sort a range of integers beginning at first and continuing to last, there are simpler ways to do it. You don't need two loops or so many extra varaibles. If you need to sort from both ends, shouldn't pivot be in the middle of the … | |
Re: The format you are using for includes will work only if all the files are in the the same directory as the main.cpp. Otherwise, state the full path name whee the compiler can find them. [code] #include "/full/path/name/ABC.h" [/code] I think you can simplify things further by just specifying the … | |
Re: You should post ALL your custom includes as another "code" entry in text, just like the main program. Nobody likes to open attachments... Did you try removing the breakpoint in question? sometimes it's just as easy or easier to insert a "test cout" that reports the state of variables in … ![]() | |
Hello all , I was experimenting with athis program using vectors. The code below works, but is not my original intent. Instead of arbitrarily adding 4 numbers, I wnted the program to keep taking numbers and growing the vector dynamically as needed without pre-allocating the resources. i couldn't figure out … | |
Re: You have to swap the values if they are not in ascending order. Something like : [code=c] if (x>y) { int tmp =x x=y y=tmp }[/code] etc... It wasn't clear whether the you just wanted to output the numbers in ascending order, or you had to maintain the variable name … | |
Re: Your header paths imply that they are a in a sub directory of your current directory. Is that true? In other words, if your current directory is */foo , the program will look for those headers in */foo/SDL Otherwise the path is incomplete and/or incorrect. From what you posted , … | |
Re: I'm no guru, but I have witten some successful scripts. A few things I noticed,; I prefer to keep the php together and the html separate as much as possible. The code at the beginning and the end can be integrated. The trigger would be ; if isset($_POST['submit']) {... which … | |
Hello all, I had this PHP script running fine on a FC4 linux box (using localhost). However when I transferred it over to a linux box running SME7.1 server, the $_POST function works incorrectly. It writes Resource ID #3 to all fields that get posted in the Insert query (MYSQL). … | |
Hello all, I know this is borderline off-topic, but then again QT4 is a C++ based program... I compiled QT4.1.1 on a fedora 4 OS. I finally got all the registration issues worked so that it works in it's native X11 form as an executable. However codeblocks is having trouble … | |
Hello all, I hope this is the correct forum for this issue. I am using the FC4 distro which the most current YUM update is QT3*. I found a more recent RPM, QT4.1* which was for FC4. It downloaded and installed without a problem (although I can't say that for … | |
For some reason this code is not accepted by the compiler. [code] template<class T, class A> void ShowMap(const map<T, A>& v) { for (map<T, A> ::const_iterator ci = v.begin();ci != v.end(); ++ci) cout << ci ->first <<": " << ci ->second <<endl; cout << endl; } [/code] The compiler says: … | |
Re: Well, none of those "admins" are what I would call a "font end" acceptable for commercial use. A secretary would be baffled. OpenOffice.base is an ODBC program that has a wizard to generate a "reasonable" interface for a single table database. anything more complex will require a bit of work, … | |
Re: I'm no guru, but I can tell you that there are different configurations of RS232 . there are specific drivers for them. The wiring is different too. The simplest one is the Xon/Xoff format. Plug that into Google and press enter. I think bala24 got annoyed because it is clear … | |
I'm just trying to get a handle on the when and why of overloaded operators. I the following snippet: the line: T& operator[] ... is there for use in the copy constructor? the line : const T& operator [] ... is there for the constructor definition? In english, the code … | |
Hello again! I am using code blocks with the gcc compiler and the gdb debugger (which is a little buggy itself). If i have a program running in debug that requires an input from the keyboard to continue, how do i do that? | |
Re: try this: g++ test.cpp -o test There is some bug with the terminal that makes using the alternate invokation of gcc neccessary. I think the g++ forces C++. Oddly, I can run a shell command from the Vim editor (running in a terminal) and the gcc will work fine. If … | |
hello all. This program is just a collection of functions to demonstrate various programming principles. What I'm saying is that don't worry about the overall function-it ain't all that... One of the principles is using a 'non member' friend function to display the output. I added this to the public … | |
Re: I'm certainly no expert, but I believe the serial I/O is setup with a tty device , then an emulation is setup in termcap. There is a command line program to do this, but I don't remember what it is. The serial device gets associated with serial port, the device … | |
Re: I've got a non-compiling program too, but if you refer to my post, i gave the compiler output to help direct people to the problem. I was wondering what you compiled it under c or c++? I thought struct wasn't used in c++??, although you have C++ includes... Sorry I … | |
Re: naw, save your money! You have all the qualifications for a long career in the fast food industry. LOL | |
...for spaces! This is another thing where I beat the code into submission. I just want someone to tell me if this is "good programming practice"- or have i gone off on a tangent. Is the use of the member access operator OK? All this program does is take a … | |
Re: Hey!maybe he can use a version of my "stripper program" that I just posted? Instead of a file, take in the array pointer and the letter to be stripped,, look at it for the "offending letter" , ignore it when writing back to the array? | |
Hello all, This is some code that another poster put up a while ago. Just for the heck of it, I tried to compile his solution, but i can't get the poiner syntax on the bubblesort function to work. I modified the call in main() to take a ref instead … | |
Re: As a noob myself, I play with these examples as a learning experience, and if i can, help others . I changed the the inital value of next to 1 a reccomended, AND switched the order of the arrays in the strncomp(). The first "if " is a "do nothing … | |
Re: wouldn't the "fish" array be a good place to use "enum"?, Then just use an integer array? | |
I have some old programs compiled in the aout format which I would like to recompile with ELF for Linux. I found this decompiler program (REC) which claims to be able to do the trick. Unfortunatly, the way he has the the download setup is not very good for a … | |
![]() | Re: Well, I'm a noob myself, but I noticed that you have a long way to go on this... First, instead of repetatively naming all the members of std, use; using namespace std; It kills all those birds with one stone! (I hope there's no PETA folks reading this!) i think … |
I have a funtion executing a loop, which semes to be progressing normally until the debugger halted with this message; Program received signal SIGSEGV, Segmentation fault. I pulled up a a backtrace and it had "normal lookuing" addresses for the this pointer and the reference variable. I could probably figure … | |
Re: was it the "return invalid" statement being in the wrong place? | |
Re: Noob question... why not just define k as an int without resorting to the fancy lib stuff? int k; cin >> k; won't that restrict the input sufficiently? | |
Wrestling with more concepts here... Other than the syntax, there doesn't ssem to be much difference between the aggregation and public inheritance. Pretty much they allow the usage of functions from another class-right? One can slightly modify the the inherited function but not the aggregated ones? Why so many ways … | |
I have been using Codeblocks, but I think I need to better understand what the "project" concept is all about. My original assumption was that it was a group of source, header and object files that pertained to a particular project. I'm discovering, however, that the IDE doesn't like more … | |
Re: As a noob, I'm trying to nail down some specifics as well. In the above code, wouldn't it be more memory conservative if the definition of bool setvalue(...) was not "inline" but defined in player.cpp? [code] tictactoe::tictactoe.setvalue(...) { ... } [/code] I ask this since i thought I read that … | |
hello all, I moved a source file from a cgywin file to codeblocks. The file compiled and ran just fine in the cgywin environment. However, the same file under codeblocks complains about an undefined reference to winmain. error: [code] Project : Console application Compiler : GNU GCC Compiler (called directly) … | |
Hello, I've put up some posts about the programming tools that I am currently using. So far, no takers. This makes me wonder what people who know what they're doing are using! M$'s IDE seemed overly complex for my modest needs. Besides, I have no use for the DLL and … | |
Re: I just let the editor do the auto-indenting for me! At least my code LOOKS like i know what I'm doing... I think i would go crazy trying to line all that stuff up manually. Especially the curly braces-ARRRRGH!!!! :eek: Is that some sort of college torture/discipline thing that they … | |
Helo again. I was experimenting with the use of ctags in Vim. Before I started, I made sure to download the lastest and greatest version of "exuberent ctags. While the Vim manual says to run ctags *.c, i took the liberty to run ctags *.cpp instead (just in case...). The … | |
This is a great group! My next hassle is the care and feeding of gdb-or at least to get it to work right. I have a program that has a custom header which contains a bug. The program is either running wild or locking up. there is no output. I … | |
Hello, Yeah that C++ term applies to me as well. I am always balancing life with too many projects! I'm an EE and entreprenuer. On the other side I like the serene life doing hikes, camping, cycling, and for that special rush...sports cars. Now I'm working on an improved database … | |
Hello all, While I understand what the class access keywords public, private, and protected are supposed to do, I just don't see how this ACTUALLY "hides variables" and makes for more bullet proof code. Do the variable names survive the compilation process? If someone was to read compiled code in … |
The End.