49,761 Topics
| |
c and c++ both being high level language?what's difference is found between this and what is object oriented programming in c++? | |
I'm trying to compile a VC++ 2010 solution of two Static Library projects and I just get this (it's the build log): [code] 1>------ Build started: Project: df_debug, Configuration: Debug Win32 ------ 2>------ Build started: Project: common, Configuration: Debug Win32 ------ 1>Build started 14/02/2012 10:51:14 PM. 1> 1>Build FAILED. 1> … | |
when will the expression (std::cin>>buff) evaluate to false(0)? I have been trying to take input until empty string is entered(simply press enter) ? Is there any other way to achieve this? | |
I discover a performance pitfall of vc2010, I compile it by release mode(O2).The results are pretty unacceptable at the first time. [code] #include<ctime> #include<iostream> /* * This is a small performance pitfall I discover from vc2010, * for simplicity, I didn't separate the header file and source file. * At … | |
Hi all, any help would be greatly appreciated. This program is supposed to allow the user to read in a txt file with ingredients for recipes. We were asked to use the fstream and to use functions to read in the info and display it. I am new to this … | |
When I compiled this program... [CODE]#include<iostream> using namespace std; class base { public: virtual void show() { cout<<"\n Base class show:"; } void display() { cout<<"\n Base class display:" ; } }; class drive:public base { public: void display() { cout<<"\n Drive class display:"; } void show() { cout<<"\n Drive … | |
Hi I came accross a code and i din't understand it Template.h [CODE] #define FRIEND_NEW template<class T> friend inline T* ::safe_new(const char*,int); template<typename T> inline T* safe_new0(const char* file, int line) { T* ptr = new T(); return ptr; };[/CODE] A.h [CODE] #include "Template.h" class A { FRIEND_NEW protected: A(); … | |
Hi, I'm a real newbie at C++, and I'm having a ton of trouble. You see, What I need to do is convert an std::string into a system::string^ so I can display it in a textbox, and I haven't found any way of doing so :icon_confused: . I always get … | |
I have a son who's in grade 8 and he is show a great deal of interest in computer programming. What is a good book for him that is easy to read, understand and detailed? Money is not an issue. Thanks | |
Hi there. I have a few hundred/thousand macro enabled spreadsheets that need to be uploaded to a database. The spreadsheets have a button that copies the data over to the database and it prompts the user for a username and password in order to do so (same for all files). … | |
write C++ program to print the sum and average of 1 to 10 using for loop? | |
so i have the following code, it inserts a number to a list and then i call my sort function which is below this function, the problem is that my sort function takes forever, is there a way i can implement my insert function so that everytime it inserts a … | |
I've tried for some time to make the following code run properly. The problem is in the comparison function of sort(comp). It compares 2 doubles but in some cases it causes the program to crash with the message "Debug Assertion failed! Program: retrace.exe File:c:program files (x86)\microsoft visual studio 10.0\vc\include\algorithm Expression:Invalid … | |
I'm writing a program where I take in a file and need to grab strings of n length (n = 3, 4, 5, 6 ,7 or 8). The issue I'm having is I need to grab these strings in a specific window. So if n = 3 I need to … | |
How do I do assembly code with the mingw-g++ compiler. All the websites I checked say that this should work: [CODE]int add(int a, int b) { int c=0; asm("mov %[aVal],%eax;add %[bVal],%eax;mov %eax,%[cVal]" : [cVal] "=i" (c) : [bVal] "i" (b) : [aVal] "i" (a)); return c; }[/CODE] But instead I … | |
Hi, a friend recommended the following winsock code to me. [CODE] #include <stdio.h> #include <winsock2.h> void abc(char *p) { char *ptr; p[1000] = 0; ptr = strchr(p,(int) "\r\n\r\n"); if(ptr) ptr[4] =0; printf("%s", p); } int main(void) { WSADATA ws; int d; char aa[1001]; struct sockaddr_in a; SOCKET s; int ii; … | |
I'm working on an assignment where I have to write my own raisePower function to take a base and a power and compute the product. The assignment states that the function needs to return a long but all input/output values should be ints. The code compiles and runs but does … | |
I'm just starting out in C++ and want to use TextOut to print a character that is generated at runtime based on keyboard input but am having trouble converting TCHAR to LPCWSTR so that it can be used in the TextOut method. my code is [CODE] LRESULT CALLBACK WndProc(HWND hWnd, … | |
I can't figure out what this error is saying. Error: C:\Users\Kyle\School\CS 372\Statistician\Statistician.cpp||In function 'bool operator==(const statistic&, const statistic&)':| C:\Users\Kyle\School\CS 372\Statistician\Statistician.cpp|225|error: passing 'const statistic' as 'this' argument of 'float statistic::sum()' discards qualifiers| C:\Users\Kyle\School\CS 372\Statistician\Statistician.cpp|225|error: passing 'const statistic' as 'this' argument of 'float statistic::sum()' discards qualifiers| C:\Users\Kyle\School\CS 372\Statistician\Statistician.cpp|226|error: passing 'const statistic' as … | |
As Part of an assignment one of the requirments is to convert a date into month format. that is the user must enter start month and year of employment and end month and year of employment for example 4 1980 till 7 2009 (mmyyy) these two dates must be coverted … | |
I am working on an assignment that I currently have. I am using cin.getline to input the title of a book. The problem is every time I run it here is how it shows up in the command prompt [B]Title: Price: $_[/B] Why is it doing this? cin.getline seems to … | |
Check out the [URL="http://en.wikipedia.org/wiki/Boggle"]wiki[/URL] for boggle. You job is to create a program that generates all possible words that can be constructed given the boggle board and a dictionary. A word has to be of length three or greater and the word has to exist in the dictionary. For example … | |
(I hope this is not already covered in another post, a quick search didn't turn up anything in the archive) So, I have recently made a lot of changes to a program, and want to quantify what those changes have done to the speed. Let us call the old version … | |
i need help with my makefile. This is my first time dealing with one.I have ,ll.C and main.C, and one header file called ll.h main.C has the header file ll.h included and some other libraries ll.C has the header file also. and when i compile it i get this error: … | |
#include<iostream.h> #include<iostream> #include<iomanip.h> #include<windows.h> void main() { int a,b,c,h,m,s,l=44; cout<<setw(l); cout<<"DIGITAL CLOCK"<<endl; cout<<"\n"; cout<<"Enter time in hours = "; cin>>a; cout<<"Enter time in minutes= "; cin>>b; cout<<"Enter time in seconds= "; cin>>c; start: for(h=a;h<24;h++) { for(m=b;m<60;m++) { for(s=c;s<60;s++) { Sleep(1000); system("CLS"); cout<<h<<":"<<m<<":"<<s<<endl; } c=0; } b=0; } a=0; goto start; … | |
I just finished up writing a class to encapsulate a pointer-to-pointer that provides auto-release functionality like shared_ptr<T>. I'm curious though, does something like this already exists, in the standard library, boost, ect? I know the idea exists, because in the Unity Engine, when you call Destroy(gameObject), any and all references … | |
search and didnt find anything that was close to this. so my assignment is to simulate a simple authentication, where the user enters their original pin or password(numbers only). it must use arrays to assign the password a pseudo-random assignment of 1-3 for digits 0-9. after that the program clears … | |
I've been staring at this code for about 3 hours, changing things back and forth and making myself feel really stupid....please, anyone, help me. [CODE]#include <iostream> #include <cstdio> #include <string> using namespace std; int main() { //declare variables int gas, time, distance; // could have used \n all in one … | |
i am a bit confused.i am feeling that one should be expert at data structures rather than language.i am learning c++ this semester,learning oop and data structures.[COLOR="Red"]is data structures more important than language?[/COLOR]what can get u into a good company? | |
What is "std" and "::" .Like for example, std::cout. Now i know what is cout for but what is std and what are these "::" for? |
The End.