342 Posted Topics

Member Avatar for Teresa_Hall

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 …

Member Avatar for Narue
0
238
Member Avatar for JRM

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 …

Member Avatar for JRM
0
113
Member Avatar for Lutzee

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 …

Member Avatar for ndeniche
0
97
Member Avatar for meiyantao

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 …

Member Avatar for meiyantao
0
169
Member Avatar for alpha_gamma

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 …

Member Avatar for iamthwee
0
483
Member Avatar for JRM

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 …

Member Avatar for JRM
0
116
Member Avatar for mathgirl

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 …

Member Avatar for WaltP
0
154
Member Avatar for Sturm

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 , …

Member Avatar for John A
0
2K
Member Avatar for Ashjenius

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 …

Member Avatar for jblacdao
0
161
Member Avatar for JRM

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). …

Member Avatar for JRM
0
104
Member Avatar for JRM

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 …

Member Avatar for n.aggel
0
354
Member Avatar for JRM

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 …

0
95
Member Avatar for JRM

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: …

Member Avatar for JRM
0
676
Member Avatar for DigitalAngel

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, …

Member Avatar for ses5909
0
195
Member Avatar for nuwan243

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 …

Member Avatar for JRM
0
119
Member Avatar for JRM

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 …

Member Avatar for Ravalon
0
84
Member Avatar for JRM

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?

Member Avatar for JRM
0
108
Member Avatar for tech291083

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 …

Member Avatar for tech291083
0
188
Member Avatar for JRM

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 …

Member Avatar for JRM
0
4K
Member Avatar for fatihbilmuh

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 …

Member Avatar for JRM
0
99
Member Avatar for newbie2c++

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 …

Member Avatar for Ancient Dragon
0
125
Member Avatar for elcrapo

naw, save your money! You have all the qualifications for a long career in the fast food industry. LOL

Member Avatar for John A
0
146
Member Avatar for JRM

...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 …

Member Avatar for WaltP
0
266
Member Avatar for bala24

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?

Member Avatar for JRM
0
153
Member Avatar for JRM

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 …

Member Avatar for Narue
0
128
Member Avatar for d1e9v85

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 …

Member Avatar for WaltP
0
199
Member Avatar for aznballerlee

wouldn't the "fish" array be a good place to use "enum"?, Then just use an integer array?

Member Avatar for JRM
0
956
Member Avatar for JRM

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 …

Member Avatar for Salem
0
138
Member Avatar for dmmckelv

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 …

Member Avatar for ~s.o.s~
0
261
Member Avatar for JRM

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 …

Member Avatar for Ancient Dragon
0
74
Member Avatar for Acquire
Member Avatar for Acquire
0
493
Member Avatar for rbinc

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?

Member Avatar for Lerner
0
221
Member Avatar for JRM

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 …

Member Avatar for ~s.o.s~
0
95
Member Avatar for JRM

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 …

Member Avatar for manutd
0
183
Member Avatar for balgarath

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 …

Member Avatar for Salem
0
156
Member Avatar for JRM

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) …

Member Avatar for Salem
0
76
Member Avatar for JRM

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 …

Member Avatar for nanodano
0
148
Member Avatar for mattyd

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 …

Member Avatar for vegaseat
0
323
Member Avatar for JRM

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 …

0
54
Member Avatar for JRM

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 …

0
63
Member Avatar for JRM

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 …

Member Avatar for happygeek
0
61
Member Avatar for JRM

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 …

Member Avatar for Ancient Dragon
0
124

The End.