447 Posted Topics

Member Avatar for chin2x

Should try the typical FAQs. [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044844545&id=1043284392[/url] You don't need conio for gotoxy, if it's the gotoxy I was thinking of.

Member Avatar for twomers
0
252
Member Avatar for GrimJack

This is an interesting discussion alright. Some of the views here I agree with, some I have to think about, but the funny thing is that it doesn't really matter. If God made the universe he might have done it via evolution or by the ways discussed in the Bible, …

Member Avatar for GrimJack
0
718
Member Avatar for Usura

[url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1048382857&id=1043284392[/url] Should cover most systems.

Member Avatar for dubeyprateek
0
105
Member Avatar for Petrock6

No. You'll have to write a cyclic shift macros or function. ie, something like #define cyclicShiftRight(val,shiftBy) ...code here... #define cyclicShiftLeft(val,shiftBy) ...code here... //... char num = 0x80; //1000-0000 cyclicShiftRight/Left(num,3); //0000-0100

Member Avatar for NeoKyrgyz
0
142
Member Avatar for bunnyboy

Nah. You'll probably have to specialise the template, I'd say. Or overload a > operator, if you feel like it.

Member Avatar for bunnyboy
0
119
Member Avatar for jrynik

Do it more like this:[code]char fileName[30]; printf( "Enter filename: " ); scanf( "%s", fileName ); FILE *pFile; pFile = fopen( fileName, "r" ); ... etc fclose( fFile );[/code]Though technically this is C++ so you should use fstreams, really.

Member Avatar for jrynik
0
147
Member Avatar for smitem03

At a guess I'd say that [inlinecode]fileHandle = fopen(Name,"w");[/inlinecode] should be changed to [inlinecode]"a"[/inlinecode] or something. If the function's being called more than once you'll want to append data to the file rather than write to a clean file, right?

Member Avatar for jephthah
0
92
Member Avatar for Azraeth
Member Avatar for Azraeth
0
95
Member Avatar for Xamas

You can do what's called 'template specialisation' which will implement certain functions for a specific type, basically.[code] template<typename ty> class myClass { private: ty var; public: myClass( ty i ); void print( void ); }; template<typename ty> myClass<ty>::myClass( ty i ) : var(i) { } template<> void myClass<char>::print() { std::cout<< …

Member Avatar for twomers
0
178
Member Avatar for kaku_lala

I'd've thought if you were comparing binary data the [inlinecode]memcmp[/inlinecode] function would have taken [inlinecode]const void*[/inlinecode]'s rather than any kind of [inlinecode]char*[/inlinecode] abstraction.

Member Avatar for ArkM
0
351
Member Avatar for GrimJack

In some physics expeiments they make very long and narrow bar magnets to simulate monopoles. Odd-opoles are awkward.

Member Avatar for ahihihi...
0
202
Member Avatar for YoungCoder

I think the risk is worth it on the off chance that it's legit. On the other hand I once got some spam which filtered through. It was the typical kind of thing that you might expect, but what really tickled me was the fact that they had a few …

Member Avatar for chriswellings
0
708
Member Avatar for phoenixlsk

Please elaborate. A linked list I can understand. Exclusive or I can understanc. Doing a linked list using XOR ... I'm not certain what you mean.

Member Avatar for manojthesingham
0
376
Member Avatar for twomers
Member Avatar for vmanes

In Ireland it's about €1.10 a [B]litre[/B], a gallon is 3.785411784 litres, which translates to about $5.20 for a gallon of Irish petrol. How do ye decipher between petrol and diesel? Are they both called gas?

Member Avatar for Dave Sinkula
0
249
Member Avatar for idb_study

Why are you flushing so much? The problem is that you can't directly print an array. You have to print from both indices, so [code]for(k=0;k<3;k++) { for(l=0;l<3;l++) { mat[k][l]=(mat1[k][l]+mat2[k][l]); cout<<" "<<(mat[k][l]); } cout<<"\n"; }[/code]Also, iostream.h isn't standard. <iostream> is. Which compiler are you using?

Member Avatar for idb_study
0
102
Member Avatar for clutchkiller

Leave the computer idle until it's automatically put on. Didn't look closely at this but it looks like it might be useful. [url]http://www.dreamincode.net/forums/showtopic17214.htm[/url]

Member Avatar for Freaky_Chris
0
186
Member Avatar for cppnewb

You could do it (quite unstandardly) via[code] #include <iostream> #include <string> // Non-standard library #include <conio.h> int main() { std::string password; std::cout<< "Enter password: "; for( char ch=getch(); ch != 0x0D; ch=getch() ) { password += ch; std::cout<< "*"; } std::cout<< "\nThe password is: " << password << "\n"; return …

Member Avatar for cppnewb
0
102
Member Avatar for sillyboy

It depends on my mood. I like it with nothing, sugar, milk, or cream and most combinations of the above, haven't tried it with milk and cream, but all others stand depending on my mood. I had it with a little milk today. But, like JBennet, I prefer tea. In …

Member Avatar for brandmantra
0
272
Member Avatar for Ronen444

Saving settings simply involves saving details to a file. Normally there are a number of variables you require, say name, age, etc. So I save them in a file like so:[quote]USERNAME:twomers USERAGE:22[/quote]Then I read in the file into a std::map<std::string,std::string>. The first parameter is the bit of the line before …

Member Avatar for twomers
0
186
Member Avatar for amt_muk

I think williamhemsworth's right, but I think you can export all members of a class in one swoop: dll.h[code=c++]#include <iostream> #ifdef TWOMERS_BUILD_DLL #define TWOMERS_EXPORT __declspec(dllexport) #else #define TWOMERS_EXPORT __declspec(dllimport) #endif class TWOMERS_EXPORT myClass { private: int thing; public: int returnThing(); void setThing(int _thing); };[/code] dll.cpp:[code=cpp]#include "dll.h" #define TWOMERS_BUILD_DLL int myClass::returnThing() …

Member Avatar for twomers
0
121
Member Avatar for christina>you

This year my family is doing a secret santa, so instead of having to conceive of seven presents to buy one! I bet I'll still (A) buy a bad present, (B) leave it late and (C) buy it for the wrong person though.

Member Avatar for techbound
0
484
Member Avatar for mayo_tech11

>> 1984 I was disappointed by that. >> Da Vinci code Eh ... I think Dan Brown's a very bad author. I love classics (somtimes), and I have a great 150 year old collection of Dickens' works. It s great for reading during storms with a large cup of tea. …

Member Avatar for techbound
0
2K
Member Avatar for pizzafiend
Member Avatar for anupam_smart
0
3K
Member Avatar for Lardmeister

I play a good chunk of the aforementioned instruments. I love atmospheric, solo, non-pretentious piano jazz though. I could listen to that [I]aaaawwll[/I] day.

Member Avatar for ddanbe
0
478
Member Avatar for sisse56

Two things first. Use `<iostream>` and not `<iostream.h>`. Also use `int main()` and not `void main()`. What problem did you encounter? It might be best to encapsulate the variables in a structure, and then make an array of 80 of these structures so that the name, gender and CGPA of …

Member Avatar for sisse56
0
1K
Member Avatar for rumencho

You can do this quite elegantly with the STL... might be advanced, I dunno.[code=cpp]#include <fstream> #include <vector> #include <string> #include <algorithm> bool char_sort_function( char a, char b ) { return a>b; } int main( int argc, char *argv[] ) { // File contains: This is a test! std::ifstream in( "test.txt", …

Member Avatar for ArkM
0
154
Member Avatar for trashed

[URL="http://curl.haxx.se"]libcurl[/URL]. It's fairly straightforward after you get used to it. Edit: Once you get the library working [URL="http://curl.haxx.se/lxr/source/docs/examples/sepheaders.c"]this[/URL] should pretty much do the trick. Just open the file in binary mode and I think it should work.

Member Avatar for twomers
0
99
Member Avatar for ohnomis

Well, there are two common ways you can represent complex numbers. One is a+ib where i is the root of -1, which is [B][I][COLOR="Red"]NOT[/COLOR][/I][/B] -1. This is called the Cartesian (or rectangular) coordinate system. The second way is to provide the equivalent hypotenuse of the a and b points (i.e. …

Member Avatar for ohnomis
0
863
Member Avatar for Lardmeister

>> He is right about HO's mother -- she was white trash. But we can't blame HO for the sins of his parents. Who's HO?

Member Avatar for jbennet
0
3K
Member Avatar for The Dude

There's a joke going around Ireland that goes along these lines... "A police man stops a car that's filled with five guys wearing white robes with hoods. It's late at night and he asks the driver where he's going, to which he responds 'We're going to [URL="http://maps.google.com/maps?num=50&hl=en&safe=off&q=kilbarrack,+dublin,+ireland&ie=UTF8&ll=53.386707,-6.165047&spn=0.02795,0.077248&z=14"]Killbarrack[/URL]'." Made me chuckle …

Member Avatar for GrimJack
0
180
Member Avatar for The Dude
Member Avatar for The Dude
2
221
Member Avatar for The Dude

>> and I never really shot anyone with a real gun That vague denial of shooting nobody doesn't fill me with confidence. >> Take the kids to a range. Let 'em shoot. I probably don't believe this, but it's funny[quote]THE BEST COMEBACK LINE for 2007… For those that don’t know …

Member Avatar for hughv
0
277
Member Avatar for itdupuis
Member Avatar for Dave Sinkula

That claims ye're the last remaining superpower... pff. What are national ID cards (past the obvious)? I landed between the 'n' and 't' of the centre... should be noted I didn't read most of the questions and didn't understand the rest.

Member Avatar for GrimJack
0
123
Member Avatar for kanwal_diku

I don't know about a name for the shop, but your caption could be: "Hang the wife. Shoot the family. Frame the kids." I saw it on a shop somewhere else and it stuck.

Member Avatar for twomers
0
139
Member Avatar for T'Scoopz

printf().... Oh and include stdio.h instead of iostream. And time.h instead of ctime. Also, C doesn't have references, so you'll have to convert those reference parameters to pointers. Just out of curiosity, why do you want to convert it to C? See [URL="http://cboard.cprogramming.com/showthread.php?t=108187"]here[/URL].

Member Avatar for T'Scoopz
0
163
Member Avatar for Aia
Member Avatar for TheBeast32
Member Avatar for Dave Sinkula

Surely the computer's gonna talk l33t so it can't be distinguished from any other 13 year old girl on the net. Of course it's gonna succeed.

Member Avatar for twomers
0
128
Member Avatar for ohara

I figure the problem might be in declaring a local variable called rowNum while at the same time having a parameter called the same. Also, your function doesn't return anything. For future reference please post the errors/warnings you get too.

Member Avatar for ohara
0
132
Member Avatar for gangsta1903

I think you might have to return a reference/pointer to the stream. Though if it's a local variable you might have to return a dynamically allocated stream.

Member Avatar for gangsta1903
0
2K
Member Avatar for alleycot
Member Avatar for bumsfeld

Why not? I made it to 2k in another forum and didn't notice until I was at 2050 ish.

Member Avatar for GrimJack
3
200
Member Avatar for freelancelote

Why don't you just do [inlinecode]myArray[counterArray] = new unsigned long;[/inlinecode] in the allocation loop? And don't forget to [inlinecode]delete[/inlinecode] everything too! Considering what you basically want is a 50-element array why don't you do [inlinecode]unsigned long *array_50 = new unsigned long[50];[/inlinecode], and then access via the [] operator as per …

Member Avatar for freelancelote
0
122
Member Avatar for Gary_nel

To copy a file you basically need to first read that file. To do this read about opening ifstreams as binary files ( [url]http://www.cplusplus.com/reference/iostream/istream/read.html[/url] ), might want to edit that code a bit. Then you'll want to save the contents of what you read to an output file, ofstream is …

Member Avatar for dougy83
0
135
Member Avatar for DeadJustice

Does [inlinecode]ifstream::get[/inlinecode] read whitespace? I think it can. Use .get() instead of using the >> operator. i.e. [inlinecode]plainVector.push_back( cyphFile.get() );[/inlinecode]

Member Avatar for VernonDozier
0
121
Member Avatar for STUDENT#101

What do you mean by three tear? All VC programs must be projects... So open up the program. Go to "File -> New -> Project -> Visual C++ Projects -> Win32 -> Win32 Console Project", or similar. I'm on MSVC '03 so the menu's probably slightly different in whatever one …

Member Avatar for AceofSpades19
0
150
Member Avatar for happy8899

>> Gee, what more do you want? A clickable link would be nice. I don't want to have to copy and paste again, Salem!

Member Avatar for Salem
0
609
Member Avatar for gangsta1903

If you use [inlinecode]fstream[/inlinecode] you can both read and write to the strem. [url]http://www.cplusplus.com/reference/iostream/fstream/[/url] To be honest, I don't see the point in reinventing the wheel, but what the hey. Why not?

Member Avatar for gangsta1903
0
137

The End.