49,761 Topics
| |
Hey guys, I need to write a C++ program that use to compare sorting algorithm. I've tried to implement counter on each of <.>, = operations I've encounter in the function (currently i am working on selection sort), however the sum of the counter doesn't really match big O selection … | |
hey guys. ive been asked to do this: Write a recursive function which returns true if the linked list is sorted in ascending order. bool isSorted(nodeType *L) why would we use a recursive function to check if it's in ascending order? can anyone help me with this. | |
i'm trying to get the last word of the sentence using strtok.. i tried this :[CODE]while (tok != NULL) { tok = strtok (NULL, " "); if((tok != NULL) && (strtok(NULL, " ")==NULL)) printf("%s", tok); }[/CODE] kinda doesn't work... anyone knows why? Yes, tok is a char * pointer.. | |
[code] //test SAT /* void initialize (int& verbal, int& writing, int& math) { verbal=0; writing=0; math=0; } void userInitialize (int& verbal, int& writing, int& math) { cout<<"Please enter your verbal score (0-800) "; cin>>verbal; cout<<endl; cout<<"Please enter your writing score (0-800)"; cin>>writing; cout<<endl; cout<<"Please enter your math score (0-800)"; cin>>math; … | |
i am trying to load the morsecode.txt into my tree struct but when i compile it i keep getting this errors error C2440: '=' : cannot convert from 'decode *' to 'int *'| error C2664: 'bintree<dataType>::insert' : cannot convert parameter 1 from 'int' to 'const decode &'| error C2676: binary … | |
Hey! I need to write a compiler for a microcontroller I'm designing... I want to use MFC to check the Syntax. I created a project in wich the View is derived from the RichEditView, Can anyone help me get info on how I can accomplish this?? I need to check … | |
Im just beginning to learn c++ and this is about the second day. Just wondering what you guys think and ways of improvement, efficiency and such. Thanks guys! [CODE] /* Super Simple Calculator - Created By FTProtocol */ #include <iostream> #include <math.h> #include <stdio.h> #include <windows.h> #define nl '\n' int … | |
Do you guys have any idea where I've gone wrong? [CODE] /* Super Simple Calculator V3.0 - Created By FTProtocol */ #include <iostream> #include <math.h> #include <stdio.h> #include <windows.h> #include <conio.h> #define nl '\n' #define PI 3.14159265 const double a=5; const double b=3; const double c=8; int x,y,choice; int ans=0; … | |
Let me ask you guys something what is the toughest type of Programming Language on techtalk? | |
[B]Hi, How to write a function that checks if the circle passes through given four points.. please answer this with code or just give me the logic and concept of writing this...[/B] | |
I have push_back(ed) Lines in 6 "places"/for 6 elements lika below in a 2D vector. So each element of the 6 consist of different many "MainLines". So when I am trying to get these out in the OutPut, I know I will use any kind of ::iterator and knowing begin() … | |
Why inheritance requires virtual functions? I read this from a book : Because inheritance generally requires the use of one or more virtual functions (a virtual destructor if nothing else), you don't want any hierarchy for small, heavily used objects. Thank you | |
Hi, I want to assign a char pointer value to enmerated value, to use in a switch statement. Given below is the code segment. I dont hv an idea how to convert and assign char pointer value to a enumerated value. Pls can someone help me to resolve this [code=cplusplus] … | |
I'm working on a lineEditor class (doubly linked list) and I'm switching it from using std::string to a template but I keep getting: lineeditor.cpp(33) : error C2143: syntax error : missing ';' before '*' when compiling. The code is: [code=c++] template <class T> int lineEditor<T>::getSize() { return maxLineCount; } template … | |
Is there a way to make a visual studio 2005 form repaint itself every 'x' number of milliseconds? Thanks. | |
I am doing a loop that will run all the time and when a change is done to the File(Source), then this file will be Copied/OverWrite file(Dest). One problem that I have is that the if-statement that says: [B]if( CurrentSourceTime != LastSourceTime ) {}[/B] is running each loop ? I … | |
[B]hi i have this function:[/B]Public Function GetFile(Filename As String) [CODE]Dim path As String Dim Fnum As Integer '---read file in one pass! Fnum = FreeFile Open Filename For Input As #Fnum GetFile = Input(LOF(Fnum), Fnum) Close Fnum Exit Function ErrorHandler: Err.Description = "GetFile: " & Err.Description & " -> " … | |
I am in a c++ programming class in my High School, and I am having some trouble with the final I was assigned. We were assigned to make a video game, so I decided to make a text adventure. My code is basically a bunch of if statements telling the … | |
This is the file I will be calling from, basically it stores something into a file called "temp.txt, so let's assume that it works and the problem is not here. This is the "file.h" file. [CODE]#include <iostream.h> #include <fstream.h> #include <string.h> #include <stdlib.h> ofstream output_file("temp.txt", ios::out); class NUM_STUD: { public: … | |
I"ll preface this with the fact I'm pretty new to C++ (my background is in Java, so having to deal with these pointers is proving to be a little confusing). I'm trying to iterate through a vector that I passed to a function. I can't get this code to work … | |
This doesn't seem to behave as I would expect (as it does in matlab, for example). I want to execute a command, but give some readable output instead of the often very messy auto-generated error (index out of range or something). [code] try { MyFunction(1,2); } catch(char* str) { cout … | |
A programme in C++ that if date is input it tells day? For example Enter Date : 1-01-1985 The day is 'Monday' Enter Date : 2-01-1985 The day is 'Tuesday' Restriictions are using If-else, switch,operators(/,%,*,+,-) while loop.logical operations(&& || ) Please write the programme or Explain the logic It starts … | |
I am doing a windows forms application in Visual Studio 2005. I have all the forms, as well as some additional classes in source files for data storage. I was wondering how to update data in one class based on another class. Does this need to be done through a … | |
I am using VC++ 2008 and wonder, that if I have made a project. "Windows Forms Application" that only consist of an Emty Form. I wonder how it is possible to Compile this so this will be an application. I have searched around in the properties and found something called … | |
Hi all, there is a big project which consists of different folders and makefile. I want to build just part of the project using eclipse since every time I build is to build the whole project. Is there anyone knowing how to do? | |
Hi all I have written a program to issue a bursary according to the amount of modules passed in 2007 and the amount registered for in 2008 , basically if the student did not pass any modules in 2007 :no bursary if the student passed 1 or 2 modules in … | |
it says two teams A & B have to play a match, and we have to find probability of team A. I can't understand the way to calculate its percentage. The main points are: 1) the match is played by two teams: A and B; 2) the first team to … | |
I have an assignment to make a text-based snakes and ladders game using Dev-C++. I have so far made a splash screen and a menu (with colours and sounds, pretty cool) using the winmm.a library and the switch/case construct. I have even been able to get player names with a … | |
Hello Everyone - I'm sorry if iasking a repeat question but i've searched the forums and cant find out what's going wrong. I am writing a program that has a pure virtual base animal class that has three subclasses - Cow, Chicken and Sheep. Objects of the three types are … | |
I am trying to write a program that can sense if Any changes was made to the file: [COLOR="Green"]"C:\\Folder1\\One\\File5.txt"[/COLOR] If Any changes was made, then this file will be copied to destination: [COLOR="green"]"C:\\Folder1\\Two\\File5.txt"[/COLOR] So what happens is that the destinationfile will be "Overwrited". I have started out som code but … |
The End.