2,839 Posted Topics

Member Avatar for FTProtocol

[QUOTE=VernonDozier;611255] It is the "Bitwise OR" operator. [/QUOTE] Actually, it's the Bitwise XOR or exclusive-OR operator. But you're right, the pow function should solve this compiler-error. Small example: [code=cpp] #include <iostream> #include <math.h> int main() { std::cout << pow(3.0,2) << "\n"; std::cin.get(); }[/code] output: 9 (3^2)

Member Avatar for Nick Evan
0
113
Member Avatar for tttstarr

Do you want to program this you self? If yes: What language? Or are you looking for an existing program to do this for you? Based on these answers your thread will be moved to the right forum.

Member Avatar for Nick Evan
0
90
Member Avatar for usmanabb

This: [code=cpp] for(int i=0; i<dataset; i++) { cout<<"Enter values"<<endl; cin>>Pa>>Pb>>K>>L; } [/code] will overwrite Pa,Pb,K & L every time the for-loop loops. So you need an array or a vector to store all the datasets. Also please read the [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]rules [/URL]and use [URL="http://www.daniweb.com/forums/thread93280.html"]code tags [/URL]

Member Avatar for usmanabb
0
730
Member Avatar for hocuz pocuz

Write all the important vars to a file. You could use [URL="http://www.cplusplus.com/reference/iostream/ofstream/"]ofstream [/URL]for that. [URL="http://www.java2s.com/Code/Cpp/File/Writetofileofstream.htm"]example[/URL]

Member Avatar for Ancient Dragon
0
261
Member Avatar for WondererAbu

[QUOTE=Agni;610426]Are we playing 'Read My Mind' here :) ...[/QUOTE] In theory, if we supplied ∞ answers, the right one would be among them :) So I'll have a look in my crystal ball and say....: Namespaces! [code=cpp] #include <iostream> namespace ClassSpace { class a { public: a() { std::cout << …

Member Avatar for Cybulski
0
154
Member Avatar for hocuz pocuz

[QUOTE=hocuz pocuz;610543]In my book it said if you use function, it would make the program runs slower isn't it?[/QUOTE] That's not something you have to worry about. If you were using a 15 year old PC and your program was x-times bigger, then it would become an issue.

Member Avatar for hocuz pocuz
0
111
Member Avatar for amit2008

What the hell are you talking about? Do you exctually think that people are going to help you if you WWRITTE Like K!DDY lolz? Here are the [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]forum rules[/URL]. Read the part about 'keep it clean' then repost your question in proper English.

Member Avatar for Nick Evan
-1
46
Member Avatar for Brent.tc

[QUOTE=John A;607841]I see that Narue became a moderator because she [URL="http://www.daniweb.com/forums/thread19571.html"]requested[/URL] the position. [/QUOTE] Us simple mortals can't get in to Area 51, so we'll just have to believe that Narue asked for the position ;)

Member Avatar for Nick Evan
0
227
Member Avatar for luckystar89

No. [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]We won't do your homework for you[/URL]. Show what you've done so far, and you'll get help. Coding the lay-out of the classes shouldn't be too hard. ps. Adding 20 questionmarks and exclamationmarks won't help either.

Member Avatar for VernonDozier
0
528
Member Avatar for TheGhost

[QUOTE=TheGhost;604834]I have problems with the map, in the below loop. [CODE] for(it = aMap.begin(); it != aMap.end(); it++){ [...] it--; } [/CODE] [/QUOTE] The code above looks a bit funny to me... 'it' will never reach map.end if your increase and decrease it in the same loop.

Member Avatar for TheGhost
0
129
Member Avatar for Sky Diploma

1. No. System expects a const char*. So you'll have to do it like this: [code=c] const char s[] = "sky.exe"; system(s);[/code] 2. To my knowledge, this can't be done with system();. You're using windows right? How about using [URL="http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx"]ShellExecute[/URL]()? [icode] ShellExecute( NULL, "open", "sky.exe" , NULL, "C:\\", SW_SHOW );[/icode] …

Member Avatar for Sky Diploma
0
146
Member Avatar for hapiscrap

Off-topic: [QUOTE=Ancient Dragon;609610]That doesn't work. Needs to be [noparse][code=cplusplus][/noparse][/QUOTE] It works for me: cpp: [code=cpp] std::cout << a << "something\n"; [/code] cplusplus: [code=cplusplus] std::cout << a << "something\n"; [/code] I always use the first because I'm to damn lazy to type 'cplusplus' everytime I post code :)

Member Avatar for Nick Evan
0
123
Member Avatar for Aamit

Something wrong with your [URL="http://www.daniweb.com/forums/thread124641.html"]other [/URL]2 [URL="http://www.daniweb.com/forums/thread124501.html"]threads[/URL]? Show how you've programmed the server and client. That way we can tell you how to implement this code in your existing code.

Member Avatar for Agni
0
111
Member Avatar for mussa187

Try this: [code=cpp] string output = google.ip_uri(ip50, ""); cout << output << "\n"; [/code] instead of this: [icode]google.ip_uri(ip50);[/icode] You should also check if argv has any values, else your program will crash when ran without any param,s.

Member Avatar for mussa187
0
112
Member Avatar for shankhs

All the above, plus: try is a keyword in c++ (try...catch) so you might want to rename the function to something else.

Member Avatar for RenjithVR
0
157
Member Avatar for toolbox03

How about toupper()? [code=c] #include <ctype.h> [...] int main() { char up, buffer = 'a'; up = toupper(buffer); return 0; } [/code] There is another way, although some people don't recommend using it, because it doesn't work on all charactersets [code=c] char buffer = 'a'; buffer += '0'; /* add …

Member Avatar for jephthah
0
232
Member Avatar for mattcrow
Member Avatar for bstylez

You could 'pipe' the output to a text file: [icode]yourprogram.exe > output.txt[/icode] Now all the output you had, will be in the txt-file

Member Avatar for bstylez
0
95
Member Avatar for Sephy
Member Avatar for purepecha

[QUOTE=Aamit;608028]Here is u r answer.. [/QUOTE] L33t speak is against the rules, and so is giving away free code. [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]Read this[/URL]. Now for your code... [code] void TestPrime(int ); void TestPrime(int n) {[/code] Why is the first line there? You don't have to declare the function if you're going to …

Member Avatar for Prabakar
0
114
Member Avatar for ze-m!nd

In that case he's trying to make a bot. I'm not going to assist in a program that causes more spam.

Member Avatar for jephthah
0
117
Member Avatar for Beemer

You have an error here: [icode] while (mark != -10, mark++)[/icode] Change it to: [icode]while (mark != -10)[/icode] And the program will end when -10 is entered The next time you post code, please use [URL="http://www.daniweb.com/forums/thread93280.html"]code tags[/URL]

Member Avatar for Nick Evan
0
92
Member Avatar for Aamit
Member Avatar for Nick Evan
0
188
Member Avatar for WondererAbu

PCH stands for 'Pre Compiled Header', so you've created a project that requires a PCH but you didn't include it. Just add [icode]#include "stdafx.h"[/icode] as the very first line in your code. Or turn PCH off, but since you didn't tell which compiler (version) you're using, I can't help you …

Member Avatar for Nick Evan
0
77
Member Avatar for shadowfire36

On what line are you getting this error? Please post you code between [noparse][code=cpp] //code here [/code][/noparse] tags. That way line numbers will be added, which is handy with this amount of code ;)

Member Avatar for shadowfire36
0
111
Member Avatar for som3on3

Why would you want to make a function for that, when the size() function already exists? Here's a code example of size() using Salem's demo-code: [code=cpp] std::map <std::string, std::vector<std::string> > array; array["fruit"].push_back( "apple" ); array["fruit"].push_back( "pear" ); cout << "The map 'array' has " << array.size() << " vector(s)\n"; cout …

Member Avatar for som3on3
0
116
Member Avatar for ohhmygod

Two things: This is a typo: [icode]FILE *ifp, ;[/icode] Remove the comma: [icode]FILE *ifp ;[/icode] And you might want to read this about [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044841143&id=1043284376"]void main[/URL] The rest of the code looks fine to me. What doesn't work?

Member Avatar for Ancient Dragon
0
230
Member Avatar for Gerlan

Your struct looks fine. It's the opening and read of the file I'm worried about. "blahblehbloh" is not a variable. And why do you need 3 ifstreams? And I'm not a big fan of infile.eof() either Here's an example to get you on your way: [code=cpp] string line; ifstream file("blahblehbloh.txt"); …

Member Avatar for Abzero
0
97
Member Avatar for martonx

I think your wrong :) First of all: Thank you for using code tags! You didn't give an implementation of the destructor, but you told the linker that it should be there somewhere: [icode]~dolgoszt();[/icode] The easiest way is to change this: [ICODE]~dolgoszt();[/ICODE] in this:[ICODE]~dolgoszt(){};[/ICODE], but you would have a memory …

Member Avatar for martonx
0
104
Member Avatar for mertucci

[QUOTE=mertucci;607007]might it be like this? it has error so much but i cant analyze it [/QUOTE] No it's not. It has a lot of errors in it. (typos, missing constructors, accessing undefined variables). I always say: "if you know it won't work, don't post it. And always use [URL="http://www.daniweb.com/forums/thread93280.html"]code-tags[/URL] when …

Member Avatar for mertucci
0
179
Member Avatar for bhoot_jb

[QUOTE]or push d functions wud differ as push(stack) in parent stack and push(int) in mini stack....[/QUOTE] Yeah....whatever. Please read the [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]rules [/URL](part: keep it clean) How about you use a vector for your 'mini-stack' and then make a map of vectors for your big (stack-)stack Since if written this samplecode …

Member Avatar for bhoot_jb
0
153
Member Avatar for joshmo

First of all, I would suggest you read your file like this: [code=cpp] string line; ifstream infile("abcdef.txt"); while (getline(infile, line)) { // do stuff } [/code] That way you can use the benefits of the std::string and you don't have to worry about the siz of char arrays etc. So …

Member Avatar for joshmo
0
3K
Member Avatar for RenjithVR
Member Avatar for RenjithVR
0
134
Member Avatar for neilconnexios

Post the code where you read the file, that makes life a lot easier. But you'll have to do something like: [code] while (lines in file) { while (words in line) { storage[line][word] = inputread; word++; } line++; } [/code]

Member Avatar for Nick Evan
0
335
Member Avatar for Cosa

You function doesn't really make sense. - Are you comparing 2d or 3d arrays? - What is "data" and where did it come from. - Are the two matrices the same size? If I wanted to make something that 2 matrices of equal size, I would do something like: [code=cpp] …

Member Avatar for Nick Evan
0
144
Member Avatar for aastephen

In line 91 you say: [icode]return name;[/icode]. Name is declared as [icode]char name[30][/icode], so it's an array of 30 chars. But you've defined your function like this: [icode]char Person::personFind(char pid[])[/icode] so it can only return 1 char. To solve the problem, I strongly suggest that you use std::string instead of …

Member Avatar for n1337
0
120
Member Avatar for Cosa

[quote][code] bool matrix::load(istream& ins) { [....more code....] return array; return true; } [/code][/quote] You can't return array because the function can only return a bool. So it will return 'true' because the memory-address of array != 0 Why don't you just use the private float** data; to store the data …

Member Avatar for Nick Evan
0
148
Member Avatar for Race

A lot of things are wrong with this code. But before I begin, you might want to read [URL="http://www.daniweb.com/forums/thread93280.html"]this [/URL]about code tags. I'll start at the top: [code] struct itemPrice // this is a global declaration { char id; double price; };[/code] Id is a char, but later in your …

Member Avatar for Nick Evan
0
76
Member Avatar for xyster

[URL="http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_sorting.aspx"]Here's [/URL]a great tutorial with some example code. (scroll down to heap)

Member Avatar for xyster
0
101
Member Avatar for boogie_1

Which would be [URL="http://www.daniweb.com/forums/forum4.html"]here[/URL] And welcome ;)

Member Avatar for jbennet
0
97
Member Avatar for architact

A few things come to my attention: [code] int n,p2,p3,p5,p7; a[1]=n=p2=p3=p5=p7=1; [/code] That's awful, what are you doing here? [code] while (a[n]<2000000000) { [/code] You never increase n, so it will always write in the same element, Besides: You declared 'a' as an array of 6000 ints, so there's no …

Member Avatar for DigitalPackrat
0
157
Member Avatar for shinpad

A char will always only hold 1 character so: [icode]char ScheduledIn[1];[/icode] is useless. It is indeed the cause of your problems. ScheduledIn is now a pointer to the first element of an array of chars. So change it back the way it was. [code] if (ScheduledIn != 'Y' || ScheduledIn …

Member Avatar for Nick Evan
0
126
Member Avatar for ryanlcs

you created a project that requires a precompiled header. So: [icode] #include "stdafx.h" [/icode] and the problem is solved. Why are you using 2003 btw? You can download 2008 for [URL="http://www.microsoft.com/express/"]free[/URL] [edit] Brilliant minds think alike ;) Only mine works slower then Ancient Dragon's. Just kidding ofcourse

Member Avatar for ryanlcs
0
156
Member Avatar for Dannyo329

I like [URL="http://www.cplusplus.com/doc/tutorial/functions.html"]this [/URL]tutorial about function better

Member Avatar for Laiq Ahmed
0
162
Member Avatar for sonia sardana

[QUOTE=sonia sardana;605893]hey frnds,[B][COLOR="Red"]First of all Thx,CZ its ur contribution [/COLOR][/B]also with the help of which I cleared VB.Net interiew & my joining is on Coming Monday. Actually I have to develop there the Mobile Applications & games. So if somebody have the similar project ,pls paste the code here.[/QUOTE] It …

Member Avatar for Nick Evan
0
83
Member Avatar for freshface001

[QUOTE=freshface001;605894] can posible to connect ms-access or sql database with c++ ?[/QUOTE] yes [QUOTE=freshface001;605894]if posible tell the tips to do it......[/QUOTE] This question has already been asked a 'few' times before. Just [URL="http://www.daniweb.com/search/search.php?q=mysql+c%2B%2B"]search [/URL]this site

Member Avatar for Nick Evan
1
69
Member Avatar for Traicey

It's explained very well [URL="http://en.wikipedia.org/wiki/Bubblesort"]here[/URL] If you know some c++, it won't be too hard to write. Come back if you have problems (and code)

Member Avatar for DigitalPackrat
0
404
Member Avatar for gazoo

[quote]2004 is not a leap year if I'm not misstaken [/quote] You are mistaken. It was a leap year.

Member Avatar for tesuji
0
895
Member Avatar for twgood

[icode]if (0 <= x && x < 49)[/icode] can also be written as [icode]if (x >= 0 && x < 49)[/icode] Now what would [i]you[/i] think will happen if x == 0 ?

Member Avatar for twgood
0
69
Member Avatar for savinki

I don't really understand what you are asking. But if you want to check if getline failed or not you could use something like this: [code=cpp] if (getline(your_stream, your_string, ' ') == failbit) cout << "something went wrong\n"; else cout << "Extracted 1 word\n"; [/code]

Member Avatar for Nick Evan
0
92

The End.