49,761 Topics
| |
Hey, time_t sec = time(NULL); gives me the seconds since 1970. But... It works with the system clock... So maybe the system clock is not synchron on two computers... Is there a way to get the seconds since 1970 WITHOUT the system clock, so that it is synchron on two … | |
how to delete a string index inside an array that the user inputs???,, could someone pls help?? | |
So i'm working on this program. And long story short, I need something that will allow the user to choose the dir/file and have the system set read-only to true. Here is a piece that I worked on. Only it crashes on the system line. [CODE]try { clear; char* dir; … | |
how would i make a new type of variable, like instead of int or double? would i use classes or something like that? | |
OK, so I am redirecting the input from a file. The input is read into a string. The problem is, when the input file ends, the program still reads empty lines and goes into an endless loop. I have added an if statement for it to detect 5 empty entries … | |
i have an insert function: [code=c] template <typename T> void insert(T item) { string T_id = typeid(T).name(); int compare; if(T_id == "char *") compare = stricmp(this.item, item); else compare = this.item < item; // ... insert here } [/code] i'm trying to compare numbers,strings,classes but when T is <char*> i … | |
Hi, I am fairly new to C++ but love to learn, so I wanted to create a simple program base on the group-party game mafia A.K.A "werewolf." Just so whoever is not familiar gets the background. I will use just an example of 10 players. In a ten player game, … | |
Hello guys... I wanna write a program that calculates a customer’s bill for the electric company. But there are two types of customers: residential and commercial. There are two rates for calculating an electric bill. Resident rates – Bill processing fee = $12.50 Service fee = $30.50 Alternative energy fee … | |
we are suppose to write a nice display code for natural numbers in Resolve its OSU version of C++, everytime I enter code and compile it though i get this error? heres my code [CODE] concrete_instance class Queue_Of_Naturals: instantiates Queue_Kernel_1a_C <Natural_Put_To_With_Commas_1> {}; concrete_instance class Sequence_Of_Queue_Of_Naturals: instantiates Sequence_Kernel_1a_C <Queue_Of_Naturals> {}; … | |
I have a class with private strings and after I set information I want to the given strings in that class I need to push that data to a vector, which is stored privately in a separate class...I feel as though my code makes logical sense but obviously I am … | |
So, my assignment is to write a program that puts a password input from the user through various tests and output its level of security. I've not had much training in this as my teacher doesn't really help much, and I'm supposed to do this over spring break. [code] #include … | |
I have been coding an IP scanner for god knows what reason. The program kind of works. It does find active computers on the network but for some reason it does not find my computer using its network ip or its internal ip (127.0.0.1). Also it can not find any … | |
hi, can anyone help me with my assignment, I'm new in c++ and any help will be much appreciated: "You must design, implement and test a simple board game. The design should follow object oriented principles and use the UML tools that were introduced earlier in the module. The coding … | |
HI. I'm new to this forum and new to C++ programming so be kind !! I've got a program that reads in a batch load of tif files works on them one at a time and then outputs the files as .png. Problem l have is that the tif filenames … | |
i am trying to create a massive list of letters and numbers using this program. but for some reason i keep getting an error (sometimes this occurs, sometimes it doesn't) [B]error PRJ0002 : Error result 31 returned from 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\mt.exe'.[/B] i also get(sometimes this occurs, sometimes it doesn't) [B]Unhandled … | |
Im trying to add up 100 grades and get the averge but it wont compile because it "cannot convert from 'int' to 'int [100]. Can anyone help me?? [CODE] #include "stdafx.h" #include <iostream> using namespace std; int main() { int total, j; double average; int grade[100]= (56,97,73,59,68,79,86,67,79,66, 95,64,98,56,79,83,75,89,73,91, 52,72,63,81,62,85,37,78,100,89, 56,89,75,76,99,66,84,98,68,59, … | |
hi, can someone please tell me the approach i should take to find the distinct substrings of a string ? | |
I have created a few applications in MFC. But I want to start saving the contents of them to files(just like word,guitar pro or paint). I tried serialization provided by MFC but I didn't like it that much because I couldn't check anything that was saved at all. So,I wrote … | |
Hi, I'm having trouble understanding how I should use pure virtual functions in my inheritance tree. I've drawn a class diagram which shows what I'm trying to achieve: [img]http://i42.tinypic.com/2qjdttd.jpg[/img] Here is what I've written: [B]main.cpp[/B] [code] #include <iostream> #include <string> #include <list> #include "base.h" using namespace std; int main() { … | |
first i had partioned my array into two subarrays. Then the quick sort switches to insertion sort for sorting the small sized subarrays. But the error is logic error, because when i enter 15 inputs, the first and the last inputs are not sorted at all..I think error is in … | |
I'm creating a program that maintains a log file. The file is created at the start up of the program and appended to throughout the run. This works perfectly fine, but I went and manually added the program to run at start up in the registry. The program runs as … | |
I am using char * for getting data from the user. Now, if i just do [CODE=C++] char * data = new char[100]; cin >> data; [/CODE] The data is corrupted, i.e. only data before whitespace is stored; and the following is an example result: [CODE] enter: "Microsoft Co." data: … | |
Hi all, I'm new to this community. I am doing a project that I'd have to write a program to connect 2(at least) PCs together. each PC works as a server and at the same time as a client, which each of them can download the file which is shared … | |
[B]MAC-LAYER LDA[/B] if (DataRate ≥ 12 Mbps) then // station is closed to AP RetryLimit =6 // default value else if (DataRate > 6 Mbps) // possible signal failure RetryLimit = 12 // begin to enlarge transmission window else if (DataRate ≤ 6 Mbps) // probability of failure is max. … | |
Dear all, I have to use a funny structure in my code which has a 2D array and allocate it later in the program. I do it but I get error which is written below. I have urgently to finish this part of the code. Would be agreat help if … | |
iam a noob at c++ and trying to learn it so go easy on me. basically i am trying to enter a some letters such as 'helody' and then check the letters it has in it and place the remaining letters of the alpahebet after it. so afterwords it would … | |
Hi! I've been looking through online materials on this matter with no concrete definitions of what I can do with this. I am trying to export some of the functions from my class residing in my executable. I have tried every which way I can imagine but the variables I … | |
Is there any function like this ? [url]http://wiki.sa-mp.com/wiki/Strmid[/url] Thank you :icon_cheesygrin: | |
First time poster, but longtime lurker. I've solved a million other problems with other threads, but this time I'm still stumped. My program is meant to take an array of dates and be able to change them, add days, and resize the array. It compiles OK, but I get a … | |
Hi, thats very weird..if I pass my RECT by reference notting wrong happens, bu if I pass by value, the numbers get crazy. The correct values are: {top=159 bottom=480 left=400 right=640} What I get passing by value is: {top=0 bottom=1 left=1964816 right=1058984360} This happens at the first moment it enters … |
The End.