99 Posted Topics

Member Avatar for Mr Bin

[QUOTE=Mr Bin;874379][B]Please help me how to do it. Thanks![/B] A 5-star hotel has 3 room types below: - Room type A, Price 80 USD / day. - Room type B, Price 60 USD / day. - Room type C, Price 40 USD / day. Room rental is calculated by formula: …

Member Avatar for tux4life
0
115
Member Avatar for phoenix911

[CODE=cplusplus] while (getline(iofile,line)) { cout << line << endl; } [/CODE] Your code is on the right track. Check out the [ICODE]getline[/ICODE] function's prototypes here: [URL="http://www.cplusplus.com/reference/iostream/istream/getline/"]getline - C++ Reference[/URL]. The file structure you have described is known as a "Space-delimited File". In your [ICODE]getline[/ICODE] function, specify the [ICODE]delim[/ICODE] parameter. (If …

Member Avatar for Ancient Dragon
0
122
Member Avatar for szcfama

[QUOTE=szcfama;875310]the problem is ... i need the reading loop to halt when data runs out but honestly I'm new to C++ and unsure how too...[/QUOTE] See this post for more details: [URL="http://www.daniweb.com/forums/post875397.html#post875397"]http://www.daniweb.com/forums/post875397.html#post875397[/URL]

Member Avatar for amrith92
0
126
Member Avatar for K'rul

Like monkey_king said, we have to know the structure of your file to help you with this. For example, Your [ICODE]Horses[/ICODE] structure: [CODE=cplusplus]typedef struct { char hname[20]; char rname[20]; char IDNum[20]; char race [20]; float time; } Horses;[/CODE] Sample File Structure (in [ICODE]HorsesFile.txt[/ICODE]): [CODE] My Horse,My R Name,My Horse ID,My …

Member Avatar for szcfama
0
241
Member Avatar for timb89

[QUOTE=timb89;874948]any ideas anyone?[/QUOTE] [URL="http://www.dreamincode.net/forums/showtopic10157.htm"]Here[/URL] is a good tutorial on linked lists amongst other C++ data structures. Have a look at their implementation of a singly linked list, and try to [B]emulate[/B] it (Emulation helps you remember [I]how[/I] to do things rather than blindly doing it)... Hope this helped!

Member Avatar for siddhant3s
0
72
Member Avatar for karjan

[QUOTE=karjan;874395]how i can convert string to int in c++ gui mode[/QUOTE] Please, refrain from hijacking threads. It would just confuse anyone having the same difficulty as the OP, and would make our jobs of attempting to answer [B]to the [COLOR="Green"]original question[/COLOR][/B] difficult. If you have a question, like the one …

Member Avatar for Narue
0
205
Member Avatar for SallyJ

[QUOTE=SallyJ;873302]Can someone please explain what \n\n means in a line of text in C++? For example ("\n\nWelcome to Main Menu\n\n"); Thanks[/QUOTE] A [ICODE]\n[/ICODE] character is a special type of character(new line character), termed as an escape sequence. It serves the same purpose as [ICODE]endl[/ICODE], which is to move the console …

Member Avatar for siddhant3s
0
6K
Member Avatar for vasek

Maybe you should try a simpler algorithm, like this one: [CODE=cplusplus] int i = 0, j = 0; // Counters string Buffer; // Acts as a buffer containing characters while(getline(FileIn, Buffer, ' ')) { cout << "M[" << i << "][" << j << "] = " << Buffer << …

Member Avatar for homeryansta
1
132
Member Avatar for dirnthelord

[QUOTE=dirnthelord;872242] I tries this code for the third pattern...I have no Idea how to get them done....can anyone post codes for all of them? [/QUOTE] This statement, to me, sounds like you are trying to get us to do your homework for you. You [B]must[/B] show some measure of good …

Member Avatar for arshad115
0
151
Member Avatar for youngfii

What are you trying to accomplish with the above code? You seem to have misunderstood the uses of arrays, and its definitely not needed in this implementation... Apart from that, your code just doesn't make sense... I would strongly recommend you take this tutorial of the C++ language, its uses …

Member Avatar for arshad115
-1
110
Member Avatar for yairzick

> C++ won't allow this. Why? Well, if you have touched upon the subject of templates in C++, then you must know that C++ templates are **type-specific**. This means that once you have declared a pointer(well frankly, *any* instantiation) to a templated class, using a certain `<class>` or `<typename>`, you …

Member Avatar for siddhant3s
0
93
Member Avatar for arenq

[QUOTE=arenq;872814]Can you tell me which basic operations on a list can cause an use of stack proportional to the size of the list? (I mean, looping on all elements...) I have problems with stack size. Is iterator post-incrementing dangerous in this sense?[/QUOTE] Could you make your question clearer? Which Stack …

Member Avatar for arenq
0
82
Member Avatar for Duki

How about: [CODE=cplusplus]// A function to convert Long to String string longToString(long In) { ostringstream OutStream; OutStream << In; return (OutStream.str()); } /* ... */ /* This function traverses your array of Long Integers (MyLongArray), and converts each long integer into the corresponding string values and stores them in the …

Member Avatar for tux4life
0
251
Member Avatar for Topi Ojala

This does have to do with a slope, but of a different sort. When you mean - moving an object in a 2D vector, what do you mean? Do you mean the STL's [ICODE]std::vector[/ICODE]? or mathematical vectors?

Member Avatar for amrith92
0
292
Member Avatar for 1obama
Member Avatar for monkey_king
0
81
Member Avatar for anilopo

Yes, I tend to agree with Narue. I would take a pot-shot and ask for you to check the closing statement of your [ICODE]Graph[/ICODE] class, and make sure that it terminates with a [ICODE]};[/ICODE]

Member Avatar for anilopo
0
197
Member Avatar for dweller

Okay, I haven't fully understood your first question, but I'll try and clear up parts of it that I have understood. Just tell us what you want to do in context of the following, or, if this isn't it, could you explain what it is that you want to do …

Member Avatar for dweller
0
185
Member Avatar for tizzo233

[QUOTE=tizzo233;870949]sorry i don't understand. you mean i should set head= new node;//i already did. doesn't that set it?[/QUOTE] I'm sorry, but I have to agree with ArkM - there's a ton of mistakes in the provided code. Just go through it, step by step and straighten out the code. You …

Member Avatar for tizzo233
0
154
Member Avatar for cruisx

Which compiler/IDE are you using? [ICODE]<conio.h>[/ICODE] is a non-standard header file. Besides this discrepancy, there seems to be no need for it in your code... If you had compiled this on a new compiler, then this would surely have thrown an error, wouldn't it?

Member Avatar for amrith92
0
149
Member Avatar for firehazrd0

Which IDE are you using? Some IDE's like Dev C++ have the choice of adding your own Application Icon even to Console Projects. Code::blocks has this facility, but you will have to create a separate resource file defining the Icon as a part of your project. But then again, this …

Member Avatar for firehazrd0
0
271
Member Avatar for utkarsh sharma

[QUOTE=Salem;870943]You need one of two things a) [URL="http://www.imdb.com/title/tt0088763/"]A DeLorean[/URL] b) [URL="http://www.thefreecountry.com/compilers/cpp.shtml"]A Compiler which actually matches your OS[/URL] The second option is usually better, as appropriate specs for option 1 are hard to come by, what with the world's energy crisis.[/QUOTE] Lol! :D ... yes, i think the second option is …

Member Avatar for WaltP
1
172
Member Avatar for Usura

[QUOTE=Usura;870967]anyone know why this wont work? [CODE] fstream f; f.open("a.dat", ios::in | ios::out | ios::binary); [/CODE] it doesnt create a.dat... also how would i switch f from read state to write state?[/QUOTE] Of course this code wouldn't create [ICODE]a.dat[/ICODE]. You are asking it to [B]open[/B] the file, not create it …

Member Avatar for amrith92
0
117
Member Avatar for Arw

Hi! Firstly, if you're a beginner, then its better if you model your game as a text-based game. Game Programming using graphics, audio etc can quickly become overly complicated if you have little or no previous experience in C++ (trust me on this). You would have to worry about a …

Member Avatar for amrith92
0
1K
Member Avatar for csurage

Maybe you should try this: Make the following Window Handles Global: HWND hWndPrincipal; HWND hWndPrincipal2; HWND hWndPrincipal3; HWND hWndPrincipal4; I'm not sure if this will work, but I made a program that is similar to what you are trying to do, and making my handles global resources sorted out many …

Member Avatar for amrith92
0
1K
Member Avatar for amrith92

Hi! [U] [B] Virus Details ; Platform: Win XP[/B][/U] My laptop is affected by some sort of virus, and as it destroyed my AVG 8.5 free installation, I downloaded Avira Free antivirus software. This virus didn't let me install it (It blocked out all antivirus websites) and keeps downloading small …

Member Avatar for amrith92
0
234
Member Avatar for amrith92

My friend got a virus on his computer some time ago. Its called MSRun32.exe, and it is absolutely wreaking havoc on his computer. Really, if it were any slower, time would be going backwards for it. I got rid of the virus, but I hadn't realized at the time that …

Member Avatar for caperjack
0
239
Member Avatar for caterina182

Hi, In answer to question 2, you can run a full scan from AVG (which version?), and simply move it to the vault, which is just as effective as getting rid of it from the system as it disables it. Some of the viruses will not 'heal' as it can't …

Member Avatar for trinitybrown
0
209
Member Avatar for amrith92

I've made a program that generates a Character's details(Game details, like level, name, HP, etc, based on a few parameters). I've added another .cpp file to it [without a main() function], but when I try to compile the whole project in Dev-Cpp, it just shows an error. My code is: …

Member Avatar for TheBeast32
0
162
Member Avatar for jrrr

[CODE=cpp] #include <iostream> #include <string> using namespace std; void change(), clue(), menu(), compare(); char n1[8], n2[8], n, password[20]; int main(){ do{ char name[20]; system ("cls"); cout<<"Menu:\n"; cout<<"1. Clue:\n"; cout<<"2. Change password?\n"; cout<<"3. Exit\n"; cout<<" Enter your choice:\n"; cin>>n; system ("cls"); switch (n){ case '1': char clue1[20]; clue(); break; case '2': …

Member Avatar for stilllearning
0
88
Member Avatar for amrith92

This is my resource file for a program: [CODE=cplusplus] #include "resource.h" // IDR_MYMENU MENU BEGIN POPUP "&File" //<=error is here BEGIN MENUITEM "&Refresh", ID_PROG_REFRESH MENUITEM "E&xit", ID_FILE_EXIT END POPUP "&Edit" BEGIN MENUITEM "&Options", ID_PROG_OPTIONS END POPUP "&About" BEGIN MENUITEM "A&bout AC", ID_PROG_ABOUT END END [/CODE] I've Checked the above over …

Member Avatar for amrith92
0
117
Member Avatar for amrith92

Here's a funny program that simulates the matrix...waaay off topic... [CODE] #include <iostream> #include <ctime> using namespace std; const int NotUsed=system("color 02"); int main() { clock(); int n; double time; char matrixwords[]=" aijk FGHIJKlmnopqrs ABCDtuvELMNO PQRS bcde fghTUVWXYwxyzZ"; char matrix[]="01001100100101011110"; clock(); for(int o=1; o<=70; o++) { cout << "/"; } …

Member Avatar for amrith92
0
187
Member Avatar for amrith92

hey, This might be naive, but how come this bit of code isn't working??? [CODE] int lc=0; read.open(filename_user.c_str(), ios::in); while(getline(read, linecount, '\n')) { ++lc; }[/CODE] Have looked through the internet, and this code seems to be fine, so what is it that makes it not work?? the output is always …

Member Avatar for amrith92
1
211
Member Avatar for amrith92

Hello, Now, this may sound stupid, as it concerns basic file I/O, but my code doesn't work correctly- at least it isn't doing what I want it to. I wanted it to write a file the first time it runs, which it does perfectly, and every time it is run …

Member Avatar for amrith92
0
122
Member Avatar for vinmicrosoft
Member Avatar for go4urs

Hi, Have you tried pinging for websites? If not, try this... 1. From the desktop, click start 2. Select Run 3. In the Run box, type command 4. Click OK 5. The DOS window will pop up. At the C:\WINDOWS> prompt type ping [url]www.domainname.com[/url] and press enter. 6. You will …

Member Avatar for go4urs
0
113
Member Avatar for The DudeAbides

[QUOTE]O20 - Winlogon Notify: jkkkjig - jkkkjig.dll (file missing) O20 - Winlogon Notify: jxngzkqo - jxngzkqo.dll (file missing) O20 - Winlogon Notify: nnlmkjk - nnlmkjk.dll (file missing)[/QUOTE] These are the virus/malware infecting your system, but I think you cleaned these off. Select these entries and "check fixed". The symptoms seem …

Member Avatar for MidiMagic
0
187
Member Avatar for gulfchap

Hi, This seems to be a new virus that seems to be affecting loads of people! Does this virus alert lead you to an *anti-virus software* marketing website? This seems to be one in a series of worldwide virus attacks of this sort, me being one of them, but of …

Member Avatar for PhilliePhan
0
156
Member Avatar for olibmx15

Hi, There could be a couple of reasons as to why your computer is running slow. It could be because you have loads of programs or processes using up all your memory(not the CPU usage) or it could be that there is a virus in your computer(again, did this happen …

Member Avatar for olibmx15
0
133
Member Avatar for DrGAKMAN

Hi, First of all, could you post a Hijack This log as this will reveal all the processes linked to the problem. Make sure that you close all other instances of any program before you run it. Again, did you run a full system scan with a good, trusted anti-virus …

Member Avatar for amrith92
0
160
Member Avatar for orcboyx

Hi, [QUOTE]Is it normal be receiving upwards of 11 million bytes and sending 2 million? [/QUOTE] Yes, it is normal to have 10.5 MB received and sending 1.9 MB when you surf the internet. This could be because you may have downloaded something, been to loads of websites, or have …

Member Avatar for amrith92
0
65
Member Avatar for sunny ray

hi, Nothing seems to be that much out of the ordinary in your Hijack This log file. Did you try a full system scan on AVG?

Member Avatar for crunchie
0
147
Member Avatar for OlyComputers

[QUOTE]O21 - SSODL: dwnrpofk - {B66919AF-4DD7-4E67-A20D-C69F0153FC49} - (no file)[/QUOTE] This indicates that you have had a malware attack recently as dwnrpofk.dll is a harmful component to have in your system. It seems to have been deleted or removed its reference from the registry(?). Everything else seems to be ok. As …

Member Avatar for amrith92
0
122
Member Avatar for ldcaudle

[QUOTE]O21 - SSODL: axrfgvek - {3AA1CF0B-64D6-4250-A16A-6B39D719FB95} - C:\WINDOWS\axrfgvek.dll O21 - SSODL: okmdepgb - {7A2046A5-4F19-4F1B-8709-686B7F246392} - C:\WINDOWS\okmdepgb.dll[/QUOTE] These two entries ought not to be there. These are confirmed class *B* threats and are known to cause computer dysfunction. As to the Regedit problem, you can do this: Start -> Run -> …

Member Avatar for ldcaudle
0
211
Member Avatar for amrith92

Hi everyone, I am Amrith, 16, and am really glad I joined Dani web. It has helped it a lot before(before I was a member and occasionally strayed here). I find this site is resource-rich and fun to browse through. I mainly do web designing and have already done three …

Member Avatar for MakeMoneyOnline
0
73
Member Avatar for prasaddlv

Hi, Have you tried to uninstall it and then reinstall it again? Sometimes, it could be a faulty installation that could cause a problem (I installed a program without the required pre-requisites and it failed to open). Again, i am no expert, but this has helped a couple of times …

Member Avatar for amrith92
0
130
Member Avatar for Logo

Yeah, it happened to me as well, but I just removed it and everything is well again! This used to happen with some of the older updates as well, but microsoft sent along some patch to fix this later on, so I wouldn't worry about getting this patch right now. …

Member Avatar for Logo
0
105
Member Avatar for anuizath2007

I agree with iamthwee. There seems no point in that segment of code! It checks a relation: if a is equal to zero or not, if a is less than b, otherwise it relates b to 0, which is pointless. Is the code meant to say, check a==(some integer) and …

Member Avatar for anuizath2007
0
89
Member Avatar for amrith92

I am experimenting with a piece of code I found on the internet (I'm still relatively new to c++), but my visual c++ express edition and visual c++ 2005 ide's are not compiling it giving some errors I can't understand fully. this is the code [code=cplusplus]/**************************************************** * File: BasicCalculator.h * …

Member Avatar for mitrmkar
0
261
Member Avatar for Black Magic

How about this book- it covers all the basics you will need to know- [B]Ivor Horton's beginning Visual C++ 2005[/B], which starts from the basics to windows programming(both MFC and Win32 API's) You needn't have to have an extensive knowledge of c or c++ to use this book as this …

Member Avatar for Narue
0
282

The End.