Little bit confuse on how can I turn this if else statement to a do while statement. Need some help.. #include<iostream> using namespace std; int main() { int div1,div2,rem,num; int count1=0,count2=0,sum1=0,sum2=0; system("cls"); cout<<"Enter divisors : "; cin>>div1>>div2; cout<<"Enter remainder to search : "; cin>>rem; cout<<"Enter number 1 : "; cin>>num; if (num % div1==rem || num % div2== rem) { count1+=1; sum1+=num; } else { count2+=1; sum2+=num; } cout<<"Enter number 2 : "; cin>>num; if (num % div1==rem || num % div2== rem) { count1+=1; sum1+=num; } else { count2+=1; sum2+=num; } cout<<"Enter number 3 : "; cin>>num; if (num …

Member Avatar
Member Avatar
+0 forum 6

Hi, I'm getting pretty frustrated with my code at this point, Im trying to implement a queue class to hold a number of integers... however dev (the compiler im using) keeps spitting out the errors [CODE] [Linker error] undefined reference to `QueueType<int>::QueueType()' [Linker error] undefined reference to `QueueType<int>::~QueueType()' [/CODE] here is the line of code of interest [CODE] { QueueType<int> queue; } [/CODE] the implementation [CODE] #include <stdlib.h> #include <stdio.h> #include <iostream> #include <math.h> using namespace std; #include "queue.h" #include "image.h" [/CODE] (image.cpp is where im calling this function from) the queue.h [CODE]#ifndef QUEUE_H #define QUEUE_H template<class ItemType> class QueueType …

Member Avatar
Member Avatar
+0 forum 2

I'm looking at getting started with [URL="http://www.wxwidgets.org/"]wxWidgets[/URL]. I currently use Dev C++ as my IDE for C++ coding. wx Widgets looks very promising and could speed up my development if used. Though what the site doesn't state (at-least none that I've found) is whether it's an IDE of its own or does it interrate with other IDEs. Will it integrate with Dev C++ or must I switch. Infact, on the topic of switching IDEs, should I switch from DevC++ to Code::Blocks or something else? I understand Dev C++ is no longer developed yet there is something called wxDevC++ but it …

Member Avatar
Member Avatar
+0 forum 2

Hi everyone just started Daniweb! I have been using devcpp for some time.I am trying to make a switch from DevCpp to Visual Studio but find the latter confusing having so many options. Recently, I did a console application that will accept a word from user and prints its anagrams. The code compiled and ran successfully. But when I try to compile the same code using Visual studio the program gives wrong output. The code is given below [CODE] //Data Structure Class Assignment //Anagrams Program //Accepts a word and prints its anagrams. #include<fstream> #include <string.h> #include<iostream> //for sorting characters in …

Member Avatar
Member Avatar
+0 forum 15

Hello all. I'm trying to compile a socket program in DevC++ but everytime I do it I get a lot of linker errors like these: [CODE] [Linker error] undefined reference to `WSAStartup@8' [Linker error] undefined reference to `htons@4' [Linker error] undefined reference to `inet_pton' [Linker error] undefined reference to `socket@12' [/CODE] I have previously run the socket program successfully in Linux but I have to export it to WindowsXP, and I must admit I'm relatively new to programming in WindowsXP. These are the header files I used in the WindowsXP version: [CODE] #define WIN32_LEAN_AND_MEAN #include <windows.h> //#include <winsock.h> #include <winsock2.h> …

Member Avatar
Member Avatar
+0 forum 4

The End.