49,761 Topics
| |
What and how does shared namespace in C++ works? Are most of the variables, types, and procedures can be used in shared name space? | |
User is supposed to type an input, and if it's not an integer, the user needs to type another. This repeats 3 times for 3 inputs which go inside an array. The integer checking works, but the problem is that when i display the 3 integers, they are all the … | |
not working: // range for for (int (*row)[4] : ia) { for (int col : *row) cout << col << " "; cout << endl; } // error: cannot convert 'int*' to 'int (*)[4]' in initialization. working: // range for for (int (&row)[4] : ia) { for (int col : … | |
i don't have a clue what is wrong here.... the program is supposed to add, subtract, multiply and divide two real numbers. #include<stdio.h> float add(float x, float y); float subtract(float x, float y); float multiply(float x, float y); float divide(float x, float y); int main (void) { int choice; float … | |
So I'm using the >> operator to read objects from a file one by one. I am simultaneously counting the objects and need to read them again one by one to print from a certain point. inFile.clear(); inFile.seekg( 0, ios::beg); Doesn't seem to work for me, and I assume it … | |
Hi, I'm having some trouble with my code that convert binary to decimal using recursion. this is my code #include <cstdlib> #include <iostream> using namespace std; void binaryToDecimal( int binaryNumber, int decimal, int weight ); int main(int argc, char *argv[]) { // binary to decimal int decimalNum; int bitWeight; int … | |
I have this weird problem. If my constructor is [header] class Book { private: vector<string>Entry; public: Book(); [cpp] Book::Book(){ Entry.push_back("0"); Entry.push_back("1"); Entry.push_back("2"); The weird thing is that it does not update when I do more .push_back. I use: void Book::addItem(vector<string>newItem) { for(int f=0; f<Entry.size(); f++) { Entry.push_back(newItem[f]); cout<<Entry[f]; } } … | |
Hi, everyone! When I'm building my project on Visual Studio 2008 that uses Xerces, I have the following linker errors: [CODE=text] 2>XmlPersistingService.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl xercesc_2_8::XMLPlatformUtils::Initialize(char const * const,char const * const,class xercesc_2_8::PanicHandler * const,class xercesc_2_8::MemoryManager * const,bool)" (__imp_?Initialize@XMLPlatformUtils@xercesc_2_8@@SAXQEBD0QEAVPanicHandler@2@QEAVMemoryManager@2@_N@Z) referenced in function … | |
Hello all, I have not tested the code I'm posting here to see if it compiles, but I have an issue in a large codebase and I believe that this should be the simplest program to demonstrate the issue; class base { public: shared_ptr<base> clone()=0; }; typedef shared_ptr<base> baseptr; class … | |
I know you are suppose to use GetPrivateProfileString(); But I dont know what the arguments for the commad is. | |
Please bear with me. This is my first post. For some reason, I can only display the strings if I put the cout in the same loop. But since I have to separate addString() and displayAllStrings(), I can't do that. My displayAllStrings() keeps failing. BUT when I write a separate … | |
I am trying to populate a vector of strings and then remove any duplicates within that vector. Here is what I have so far. I am getting an error saying: Error 2 error C2064: term does not evaluate to a function taking 2 arguments . void removeDup() { vector <string> … | |
Hey guys, I need a function that reads a text file and stores the character someway, (I am assuming a 2D Array would be best?) then a function that reads through the characters and if the char is something specific (like "X") then it would draw a square (QUAD) 10wx10h … | |
I am trying to get my homework assignment to work for class, but I cant seem to get it. Heres the assignment. [QUOTE]Write a program that asks the user to guess the next roll of a six sided die. Each guess costs $ 1. If they guess correctly, they get … | |
Looking for an assist to modify this program based on the following info: Using two temporary linked list iterators and three for-loops modify a linked list with a perfectShuffle (); function (only modify the TODO line of code).. Here is the driver code: #include <iostream> #include <stdio.h> #include "linkedList.h" using … | |
I am working with sql server using ADO provider. My code uses recordsets and commands to run quries and I fail to understand a basic issue - connections. In my code, they set a connection string (which is being built in the code, not taken from other ADO element) to … | |
Hi everyone! So I have this code to modify. I need to write a code inside the **int main** field, that would cause 37 launches of the constructor called M_48(). I have no idea how to solve this. Any ideas? | |
After playing for 5 or more times the total scores are going out or range (In the table generated at the end). I tried using long but didnt helped. #include<conio.h> #include<iostream> #include<stdlib.h> #include<string> #include<windows.h> #include<time.h> using namespace std; unsigned flag=0, ply_m,ply_t,ply_s,zz,i; //funct for gotoxy void gotoxy(int x, int y) { … | |
I accidentally closed my Toolbox in VC++ IDE.. now I donno how to bring it back. Please help... | |
i would like help making a little piece of code that just counts down from a number, example 30 to 0. the program shouldnt display the previous numbers counted. thats it, any hel-p would be great. | |
Hey everyone I was working on a small tool and also refreshing my programming skills. my problem is I want to pick a random number from 60,000 to 200,000. it does that but the number it displays are not dramaticly changed. For example if it out puts 062045, i hit … | |
I'm setting up a finite state machine structure as a proof of concept to be used in other projects. The states have function pointers that point to actions they are allowed to perform during certain events and transitions. I'm trying to restrict these pointers to be a part of a … | |
i want to create a warehouse program for school using the random access file management. i built a class called product(prodotto) with many private var and i must create a new record. The function checks if the product already exists with the seekg pointer and reading the file. After u … | |
My problem I am having is when I use execl, it close my main program. I want the program I create can open other programs or create other actions with linux. I am looking to help getting on the right path. Should I be using execl? Why does it close … | |
Hello i'd like to ask a quick one. -Mfc VC++ 6 application. -NO Unicode support by design. -Greek characters appear fine in all dialogs since OS is Windows Greek version (?) -Greek text is both hard coded in c++ source files and retrieved from mysql database. -ONE specific Edit Box … | |
Hi guys. I was wondering how Cnet Downloader, and ninite.com works. Is there a backend server which compiles the exe file before every download? Is there any other way to modify something in an .exe file without recompiling? Thanks. | |
typedef double (*sizefn_t) (double *); sizefn_t sizefn = userSizeFace; Dear friends: Could you pleaset tell me what is the meaning of the code, what does sizefn_t represent. what is the meaning typedef. | |
Hi All, Can any one tell me the what are the differences between WinSock and WinInet in mfc? Thanks in advance....... | |
| |
Dear friends: I download a c packge for my computation work. there is a function " aft2boundar(int *, double *)" in it. i write a "main.cpp" with vs2010, when i compile, it gives me the following error unresolved external symbol "int __cdecl aft2dboundary(int *, double*) but i have include the … |
The End.