49,761 Topics

Member Avatar for
Member Avatar for srijan1990

c and c++ both being high level language?what's difference is found between this and what is object oriented programming in c++?

Member Avatar for mike_2000_17
-1
118
Member Avatar for tomtetlaw

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> …

Member Avatar for tomtetlaw
0
97
Member Avatar for profyou

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?

Member Avatar for deceptikon
0
178
Member Avatar for stereomatching

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 …

Member Avatar for stereomatching
0
168
Member Avatar for ginan

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 …

Member Avatar for ginan
0
9K
Member Avatar for stevanity

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 …

Member Avatar for gerard4143
0
198
Member Avatar for chamika.deshan

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(); …

Member Avatar for L7Sqr
0
161
Member Avatar for Wiki_Tiki

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 …

Member Avatar for RhondaCos
0
2K
Member Avatar for hkhk106

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

Member Avatar for sumtaru
0
239
Member Avatar for Navlag

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). …

Member Avatar for toske
0
196
Member Avatar for Loafer
Member Avatar for WaltP
-5
151
Member Avatar for ruval002

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 …

Member Avatar for Ancient Dragon
0
130
Member Avatar for The_Purple_Mask

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 …

Member Avatar for Fortran IV
0
205
Member Avatar for Dewey1040

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 …

Member Avatar for L7Sqr
0
146
Member Avatar for Labdabeta

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 …

Member Avatar for gerard4143
0
1K
Member Avatar for loumbut

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; …

Member Avatar for Fortran IV
0
1K
Member Avatar for NickPatton

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 …

Member Avatar for Caligulaminus
0
186
Member Avatar for alastair1008

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, …

Member Avatar for Ancient Dragon
0
268
Member Avatar for bennetk2

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 …

Member Avatar for gusano79
0
332
Member Avatar for skannigan

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 …

Member Avatar for skannigan
0
162
Member Avatar for arold10

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 …

Member Avatar for deceptikon
0
122
Member Avatar for mrnutty

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 …

Member Avatar for mrnutty
0
264
Member Avatar for miturian

(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 …

0
96
Member Avatar for ruval002

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: …

Member Avatar for caut_baia
0
168
Member Avatar for sohaib paracha

#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; …

Member Avatar for Eagletalon
0
188
Member Avatar for VBNick

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 …

Member Avatar for VBNick
0
144
Member Avatar for Whoaa512

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 …

Member Avatar for Whoaa512
0
345
Member Avatar for Reclaimer0418

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 …

Member Avatar for MandrewP
0
769
Member Avatar for inspire_all

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?

Member Avatar for WaltP
0
125
Member Avatar for Diamond3x

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?

Member Avatar for neartoyou
0
253

The End.