109 Posted Topics

Member Avatar for mattyd

Client: "Your product doesn't work!" Raye: "Bummer." I can get away with that though. My clients are cool about problems, and I fix them promptly enough that there aren't any complaints. :)

Member Avatar for Sulley's Boo
0
182
Member Avatar for flageolet

[QUOTE=flageolet;307165]The code below works for the first question (first half of the code), the program then proceeds to the second questin, but it never stops to await the answer.[/QUOTE] Even without looking at the code, I can guess what the problem is with good accuracy. ;) It's probably the single …

Member Avatar for flageolet
0
221
Member Avatar for ankit_the_hawk

[QUOTE=ankit_the_hawk;306848]I wanted you people's point of view on this project I made in C++ sometime back...I would be glad to recieve comments from anyone and everyone...Pls do check it out...So that I can know the quality of my project[/QUOTE] It's just an exe. I'm happy to review your code, but …

Member Avatar for ankit_the_hawk
0
116
Member Avatar for edek

[QUOTE=edek;306676]Would you be so kind and tell me what does ^ symbol mean in definition of object, example: [code]class ^Object[/code] Thanks in adv[/QUOTE] It doesn't mean anything that I can think of. Even if you look at C++/CLI where ^ is used for .NET reference types, it's still not used …

Member Avatar for Ravalon
0
952
Member Avatar for bosko

[QUOTE=bosko;306724]Hi all! I have some biginner question: I've started to learn C from the Kernighan&Ritchie book, using Pelles C compiler. Why this code (from the book) dont work: #include <stdio.h> /* count characters in input; 1st version */ main() { long nc; nc = 0; while (getchar() != EOF) ++nc; …

Member Avatar for ~s.o.s~
0
124
Member Avatar for theflier13

[QUOTE=theflier13;306692]Error 1 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int apstring.h 70 Error 2 error C2556: 'std::ostream &operator <<(std::ostream &,const apstring &)' : overloaded function differs only by return type from 'int &operator <<(std::ostream &,const apstring &)' apstring.cpp 166 Error 3 error C2371: 'operator …

Member Avatar for Ravalon
0
234
Member Avatar for fesago90

[QUOTE=fesago90;306027]Aright, now all of you might be tired of my sometimes info-lacking posts about binary files. ... but I have another quick question: How do I write and read a double in a binary file? Code as simple as the following does not work (which is the usual code for …

Member Avatar for Ravalon
0
5K
Member Avatar for Boldgamer

[QUOTE=Boldgamer;305838]In the book I am learning from it states that using the "continue" and "break" keywords shoudl be avoided when possible.[/QUOTE] Your code should flow logically so that people can read it and understand it easily. The whole single entry single exit dealie from structured programming principles is too strict …

Member Avatar for Dave Sinkula
0
123
Member Avatar for jmsnclr

[QUOTE=jmsnclr;303983]:-|Hi all[/QUOTE] Hi! :) [QUOTE=jmsnclr;303983]Does every new programmer run into this or am I making things harder than they have to be?[/QUOTE] There are about as many solutions as there are new programmers. That alone should make you feel better, but don't forget that size and quality are completely independent …

Member Avatar for jwenting
0
83
Member Avatar for lotsofsloths

[QUOTE=lotsofsloths;305204]Yes [B]pass[/B] is the password the user is supposed to enter. how do i now change [B]int[/B] into something that can hold a letter value?[/QUOTE] There's a string type in the <string> header that's pretty intuitive to use. [code] #include <iostream> #include <string> using namespace std; int main() { string …

Member Avatar for jwenting
0
115
Member Avatar for HS20064972

[QUOTE=Ancient Dragon;305183]I see nothing wrong with his main() -- argc and argv parameters are optional.[/QUOTE] I guess he's talking about empty parameter lists being deprecated in C. And old C headers are deprecated in C++ so that program is somewhere in between C and C++. But let's be serious and …

Member Avatar for ~s.o.s~
0
140
Member Avatar for amishosh

[QUOTE=amishosh;305829]For life of me I can't remember how to get th alignment right.[/QUOTE] The alignment includes any precision and formatting characters. Try this. [code] printf("%7.2f ",mat[i][j]); [/code]

Member Avatar for Ravalon
0
86
Member Avatar for JoBe

[QUOTE=JoBe;298199]Hello ladies and gents,[/quote] Hi! :) [QUOTE=JoBe;298199]1) a = b + c * d << 2 & 8 (a = ((b + (c * d)) << 2 & 8))[/QUOTE] You missed some parentheses. << and & have different precedence. [QUOTE=JoBe;298199]2) a & 077 != 3 Don't think there is a …

Member Avatar for ~s.o.s~
0
191
Member Avatar for Marks256

[QUOTE=Marks256;305026]So would it be ok if i just stuck with C++, but also use some C commands? I really like some of the C commands, and dis like some of the C++ commands, but it also works the other way...[/QUOTE] You can use C specific features in C++, but getting …

Member Avatar for Nick Evan
0
157
Member Avatar for Mix

[QUOTE=Mix;304640]csc /out : DemoLogo2.exe DemoLogo.cs /out: LogoNamespace.netmodule LogoNamespace.cs Its a command in a book but it gives no reference. I'd like to know exactly whats going on here if anyone can assist[/QUOTE] csc is the C# command line compiler. The /out option tells the compiler the name and type of …

Member Avatar for Ravalon
0
110
Member Avatar for jerryodom

[QUOTE=jerryodom;303077]Hi Everyone,[/quote] Hi! :) [QUOTE=jerryodom;303077]Has anyone ever switched over in their career? Any advice for landing that first job in the new area would be appreciated.[/quote] I've made two switches due to economic pressure. My first specialization was C/C++ on Solaris, and I moved to Java on Linux to keep …

Member Avatar for indienick
0
205
Member Avatar for raydogg57

Hi! :) Okay, your premise is sound, but the execution could use some work. If you don't mind me turning into an evil code reviewer, I'll point out some ways to make your code better. [code] using std::cout; using std::cin; using std::endl; [/code] This is my personal preference. I think …

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

[QUOTE=JRM;304254]For some reason this code is not accepted by the compiler.[/QUOTE] You have a good compiler! :) It accurately doesn't treat [INLINECODE]map<T, A>::const_iterator[/INLINECODE] as a type because it relies on template parameters, T and A. To make the compiler believe you, you need to use the typename keyword. [code] template<class …

Member Avatar for JRM
0
676
Member Avatar for JoBe

[QUOTE=JoBe;304116]Hi Dave[/quote] I'm not Dave, but hi anyway! :) [QUOTE=JoBe;304116]You're speaking of the C90 list, but yet, the Draft shown is C89, am I missing something?[/QUOTE] C89 and C90 are different documents of the same standard. C89 was ratified by ANSI and C90 was ratified by ISO with slightly different …

Member Avatar for Ravalon
0
193
Member Avatar for campkev

[QUOTE=campkev;297186]that's what I am looking for, but a non-.NET version[/QUOTE] I'm sure you could find something with google, but it's not hard to write your own either. [code] #include <algorithm> #include <iostream> #include <string> #define array_length(array) (sizeof (array) / sizeof (array)[0]) namespace Raye { using namespace std; struct HTMLReplace { …

Member Avatar for jwenting
0
3K
Member Avatar for flageolet

[QUOTE=flageolet;302992]I would like the program to repeat the "how many" question until the input is an integer: [CODE] int X = 0; number_patients: cout << "how many?\n"; if (! (cin >> X)) { X = 0; cout << "please enter a number\n"; cin.clear(); goto number_patients; } [/CODE] This creates an …

Member Avatar for Ravalon
0
91
Member Avatar for mehakkapur

[QUOTE=mehakkapur;302795]If you have to count numbers of 1 in a 32 bit word. Other than checking every other bit or dividing the bits is 4 parts and then using lookup table. What will be some other most efficent way ?[/QUOTE] Can you show an example of what you need to …

Member Avatar for Ravalon
0
96
Member Avatar for wheelz

[QUOTE=wheelz;302526]School project, just wondering if there is anymore documentation that I woould need?[/QUOTE] You have too much. I'll go through each of your comments and describe why. :) The neat thing is that weak comments can be spotted even without looking at the code that's being commented. ;) [QUOTE=wheelz;302526]//********************************************************/ // …

Member Avatar for Ravalon
0
131
Member Avatar for elodie

[QUOTE=elodie;301790]Hi,[/QUOTE] Hi! :) Doesn't AnsiString provide a c_str() member too? [code] if (OpenFileDialog->Execute()) { std::ifstream infile(OpenFileDialog->FileName.c_str(), std::ios::in | std::ios::binary); } [/code]

Member Avatar for Lerner
0
1K
Member Avatar for hariza

[QUOTE=Ancient Dragon;302100]Since '\n' is always the last character in the buffer there is no point using those functions -- they are a waste of time and will do nothing more than slow down the program if used frequently. My opinion is that it is a [b]misuse[/b] of those functions.[/QUOTE] But …

Member Avatar for Dave Sinkula
0
152
Member Avatar for NeroToxic

[QUOTE=NeroToxic;302044]Hi all, I have an application written in C#, it connects to a SQL database using SQL Server 2005 Express. What I need to do is install my application on multiple computers on a network, but they must run from a single database on one of the machines, so I …

Member Avatar for Ravalon
0
105
Member Avatar for shouvik.d

[QUOTE=shouvik.d;297066]Say if we ve certain private methods along with private data members and public methods. other than friend function is thr any other way we access these members(they being private only) directly. its one of the requirements in a project of mine.[/quote] The only other safe way is a member …

Member Avatar for shouvik.d
0
277
Member Avatar for mastern200

[QUOTE=mastern200;301801]The problem is, i cant get the correct answer. It just says: Would you like to play again?[/QUOTE] You don't have any code that does anything with the answer. All you do is print an expression and take user input in a conditional loop, so it's a little much to …

Member Avatar for rinoa04
0
99
Member Avatar for fesago90

[QUOTE=fesago90;301552][CODE=c++]#include <cstdlib> #include <iostream> #include <string> #include <algorithm> using namespace std; int main() { string foo = "123"; if(count_if(foo.begin(), foo.end(), isdigit) == foo.size()) { cout << "\nGreat!\n"; } cin.get() }[/CODE] Does not work on bloodshed v4.9.9.2!!! It outputs the following error: But it does work on VC++ Express 2005... (obviously …

Member Avatar for Ravalon
0
158
Member Avatar for Woeb

[QUOTE=Woeb;300935]Hello[/quote] Hi! :) [QUOTE=Woeb;300935]What I don't understand is this: As the link in [inlinecode]end[/inlinecode] changes as well as the node [inlinecode]end[/inlinecode] is pointing to changes while the old list is being copied, does this not also change the link in [inlinecode]top[/inlinecode] as well as the node that [inlinecode]top[/inlinecode] is pointing …

Member Avatar for Woeb
0
296
Member Avatar for 80s

[QUOTE=80s;296277]What problem(s) are in the function ?[/QUOTE] None. It looks okay except you don't actually call the function. :) You could also work on your formatting a bit. Consistency is the key. [code] #include <stdio.h> void triangle(int n); int main(void) { int rowHeight = 0; printf("\n Enter a number to …

Member Avatar for Aia
0
498
Member Avatar for umairsaleem_88

What operating system are you using? If it's newer than Windows 95 or 98, then I don't think BGI will work. And I'm not sure about Windows 98.

Member Avatar for WaltP
0
114
Member Avatar for sivaslieko++

An array size has to be a compile time constant. [INLINECODE]const int size = 10;[/INLINECODE] is a compile time constant because the value you initialize it with, 10, is also a compile time constant. [INLINECODE]const int size =pow(2, Depth()+1)-1;[/INLINECODE] is not because the result of pow() and Depth() aren't known …

Member Avatar for John A
0
151
Member Avatar for sivaslieko++

[QUOTE=sivaslieko++;297805] But how can I print this tree like this: [B]23 1,45 -,2 | 31,52 -,- | -,3 | -,- | -,234 -,- | -,- | -,- | -,5 | -,- | -,- | -,- | -,- At the last two line it is necessary to print null subtree of …

Member Avatar for sivaslieko++
0
127
Member Avatar for apurv

[QUOTE=Bench;298209]Sounds like a virus to me... You won't find anyone to help you out with that here.[/QUOTE] It's called a quine. They're completely harmless diversions.

Member Avatar for Bench
0
96
Member Avatar for murschech

[QUOTE=murschech;295744]In using "cin" for getting input I have about a 99% success rate. In the remaining 1% of cases the program does not pause for input. What causes this and how does one fix it?[/QUOTE] You are probably mixing formatted and unformatted input. Formatted input treats whitespace differently than unformatted …

Member Avatar for Ravalon
1
160
Member Avatar for cyberjoe

I use whatever convention is selected for the project. :) 9 times out of 10, there's already a substantial code base and proper form dictates that any new code should be consistent with the old code. For new projects I define a convention based on the needs of the project, …

Member Avatar for jbennet
0
96
Member Avatar for unclepauly

Is this a C++ map? Those are usually written as red-black trees and they'll probably have a parent pointer too. You can guestimate three pointers per node plus the size of the keys and values per node. So 7 nodes with 32 bit integer keys and values and 32 bit …

Member Avatar for unclepauly
0
91
Member Avatar for Gunner54

sscanf is delimited by whitespace. You'll get the first word only unless you use some other trick. Personally, I'd say that you should ditch sscanf altogether and to it manually so that you have more control. But you can also use a scanset if you want. For example, to read …

Member Avatar for WaltP
0
167
Member Avatar for Aia

When you know that you need values bigger than any type can hold, you use something like [url=http://www.swox.com/gmp/]GMP[/url] to handle arbitrary precision.

Member Avatar for Aia
0
190
Member Avatar for bala24

[QUOTE=bala24;297112]Hi , can anyone give me some good links to learn all about data structures and using them in C.[/QUOTE] [url=http://www.nist.gov/dads/]This[/url] is about the only link that covers enough data structures to count as 'all about data structures'. Most of the links go to outside sources that have C code …

Member Avatar for Dave Sinkula
0
85
Member Avatar for c++34

That's not a standard function, and I haven't ever seen it before. What library is it from?

Member Avatar for John A
0
145
Member Avatar for jan1024188

[QUOTE=jan1024188;297183]hi[/quote] Hi! :) [QUOTE=jan1024188;297183]Now i want to know how to make "hidden" program. I dont care if is listed in processes, but cmd musnt appear on the screen...any ideas?[/QUOTE] You need to create a windows application instead of a console application and just don't show a window. Easy greasy if …

Member Avatar for jan1024188
0
203
Member Avatar for indulgence

[QUOTE=indulgence;297114]Hello Everyone! I'm new here.[/quote] Hi! :) [QUOTE=indulgence;297114]The progam works well but i'm not sure the CLASS part is right so do help mi please.[/QUOTE] Well, if the program works well then I don't see a problem with it. ;) The class looks fine, but usually Point classes make x …

Member Avatar for Bench
0
233
Member Avatar for Sturm

[QUOTE=Sturm;296754]Is there a way to start program not via dos? Im writng a shell script after all...it's kind of cheating...[/QUOTE] A shell script is just a file that batches shell commands together so that you don't have to constantly retype them. If doing things via the shell is cheating then …

Member Avatar for John A
0
118
Member Avatar for Elfshadow

[QUOTE=Elfshadow;295796]I'm only a beginner C++ programmer and I don't like VC++ express because of installing the platform SDK:eek:[/QUOTE] You only need to install the platform SDK if you use the windows API. If you are just now learning C++, that will be a while away because you have a lot …

Member Avatar for micdareall
0
108
Member Avatar for sgriffiths

[QUOTE=gcs584;296478]...or you could save yourself a lot of time and utilize the following function by including [I]string.h[/I]: [code][COLOR=#008000]char * strtok ( char * str, const char * delimiters )[/COLOR][/code] where: [I]str[/I] is your original string to search through [I]delimeters[/I] is a pointer to an array of delimeters[/QUOTE] And what are …

Member Avatar for gcs584
0
193
Member Avatar for artee

You want to do some research on master/child databinding relationships. It sounds long and complex, but it's really not that hard. :) You end up doing something like this with BindingSource objects. [code] bsMaster.DataSource = MyDataSet; bsMaster.DataMember = "MasterKey"; bsChild.DataSource = bsMaster; bsChild.DataMember = "ChildKey"; gridMaster = bsMaster; gridChild = …

Member Avatar for Ravalon
0
84
Member Avatar for va-yik-ra

[QUOTE]So the question is how to solve this problem without the possibility of overflow?[/QUOTE] Use a library like [url=http://www.swox.com/gmp/]GMP[/url] for arbitrary precision math. That's really the only way to do it without heaping annoying restrictions on the end user.

Member Avatar for Ravalon
0
121
Member Avatar for Virii

I don't have a degree, so take my opinion with a grain of salt please. :) [QUOTE]I've heard that Computer Science is mainly theory, and that it's also very boring if you already understand how everything works.[/QUOTE] You probably don't really understand how everything works. Taking a focused course in …

Member Avatar for WaltP
0
102

The End.