49,761 Topics
| |
| |
Hey all, I just started programming C++, (only formiliar with matlab/mathematica for image processing) . I like to find the min of my grayscale image. My image is a part of frame token from a webcam. But I don't even know what type of object my image is. Is it … | |
Hi all, Currently im doing a little coding to communicate between two PCs through RS232 ports. i am thinking of using: "writeFile" to send a string to the other PC, "readFile" to read back the acknowledgement string from that PC and "strcmp" to check if the read back acknowledgement string … | |
Hi, I'm studying C++ at the university and came across a problem in my exercises. Basically I'm trying to retrieve an integer from an object via its getter method. The object is stored in a vector. Here's the main.cpp part: [CODE] vector<Client> vektori; ... vektori.push_back(Client(account, firstName, lastName, balance)); ... vector<Client>::const_iterator … | |
C++ has a standard function isinf()? like isnan()? If yes, it returns true in case of +inf and -inf also? | |
I am watching lectures on C++ from the stanford online courses website. I have a slight problem in understanding how memory is allocated for a string in C++. Basically when you declare a vector the constructor is called and memory is allocated for the array arr, numUsed and numAllocated are … | |
hi everyone how to generate random codes given to the computer if i give three codes example : 123,234,567 i need to output anyone of these at a time | |
I have a problem with code I am writing. I am supposed to count the instances of each specific digit that the user inputs. I am supposed to output blank digit appears blank time(s). I figured out how to get the numbers to go to different indexes in the array … | |
Hello guys, This project requires the use of an array of pointers to aRandomNumberGenerator (i'll call it Random for short) objects. Both aDie and aCoin are derived classes of the Random class. I am to use the array to call the virtual function generate. My problem arises in my main … | |
((serverDlg*)m_pDlg)->OnReceive(port); I built a server using MFC, and had to get the foundation going by using examples online. The OnReceieve(port), is a function that I created in my CDialog class. ((serverDlg*)m_pDlg) is the part I don't get. This line of code is in a function in my socket class, and … | |
Hi everyone, I was wondering if there's a way to write a command to the terminal from a c++ program. I'd like to be able to have some kind of loop with a Makefile, so the last command on a makefile runs the makefile again. Otherwise, is there a way … | |
Hello, I'm simply trying to keep track of how many times a space is encounteed in a string and then print the number of times to the console. Can someone please examine and give me a tip on what is wrong? Thank you! [CODE] #include <iostream> using namespace std; int … | |
one thread try to read from vector and another thread try to delete from vector how to do it | |
Hi everyone, I want to copy the output of a program with another program so I can write it to a file. I'm running Ubuntu Linux, and I'm trying to see what my system is like with hwinfo. The list is too long, though, so I need to put it … | |
I'm trying to compile an executable (ELF file) that does not use a dynamic loader. I built a cross compiler that compiles mips from linux to be used on a simulator I made. I asserted the flag -static-libgcc on compilation of my hello.cpp file (hello world program). Apparently this is … | |
Hey! I am using UDP sockets in IPV6 and i can't get the server to receive the packet sent by the client to the All Hosts ipv6 address ff02::1. The client is sending the packets as i see them in the wireshark. Can you help please? [CODE] Server #include <sstream> … | |
// function declaration char* operator LPCTSTR(); // defenition char* String::operator LPCTSTR() { char* szArry = NULL; szArry[1024]; reurn(szArry); } how we can create a LPCTSTR string class member function in c++ | |
So far I have written a program that draws text to the screen and I am able to change the font type but I am unable to change the font size. Here are the 3 main parts of my code that I think you need to see. Font structure: [CODE]typedef … | |
My program basically asks the users for a value (s) then calculates and displays the First, Middle, Last, and Final. The users have a choice to enter the value either in integer, real or character. If the user enters it in real or character, it will be converted into integer … | |
I have tried to create a simple class where the program passes a name and telephone number to my class type and then prints it to the screen. It tells me I have undeclared identifiers, but I am constructing my program just like an example we did in class. Can … | |
Say you have a class Foo, and it contains some member variables. And in that class you have a const-correct function. Can you code some way in C++, that changes the private member variable, inside the const-correct function. For example : [code] class Foo{ int num; public: void doIt()const{ num … | |
Can anyone help me create functions for doing this 1) three bool methods onCircle (Point *), outofCircle (Point *), and inCircle (Point *) for a Circle object C (so C->onCircle (P) for a point P means the point P lies on the circle C (i.e. the distance of P to … | |
Ok, i have my code: [CODE] int seconds; clock_t clock(); seconds = clock()/CLOCKS_PER_SEC; if (seconds == 8){ FIVE.SetPositionX(-1); } //.... if ((AdventureGame.keypressed[DIK_F]) && (WOO.positionX == -10)){ //reset clock() here FIVE.SetPositionX(-5);} [/CODE] the clock starts when the program is run and after 8 secs, FIVE moves position. When i press F, … | |
Iam new to programing, so be gentle!!!! I have to program the Fibonacci Sequence up tothe first 29 numbers. The output starts at 1 2 3 5, not 0 1 1 2. What am I doing wrong to not get the 0 1 output. Here is the code: [code=c++\] #include … | |
Hi, I am writing a C++ program to "find and replace" strings. Following is the code: [CODE=c] void pt::replace() { string str( textpath ); string searchString( "\" ); string replaceString( "\\" ); assert( searchString != replaceString ); string::size_type pos = 0; while ( (pos = str.find(searchString, pos)) != string::npos ) … | |
This is my assigment and i have no idea to do that. Somebody please help ! Write a program that reads from a file the number of candidates in a local election, then their last names and the number of votes received by each. Use dynamic memory allocation to store … | |
Well I've been learning C++ on and off but I plan to stick with it and I'm going to try to program at least two hours a day everyday for the rest of summer and hopefully when school starts again if I can. How often do you guys program? (just … | |
Here is the code that I have been given for an assignment. The modification that I need to make is to allow the program to read 10 sample points and determine which are contained in the plume boundary. I have included the modification that I think is appropriate for the … | |
i want to know the advantages and disadvantages of single and multiple line comment in programming language in term of reliability, readability and writability. please help | |
ei, anyone, i need help for my project, we need to create an info. system in c++ with the following functions: [LIST=1] [*]search records [*]add records [*]delete records [/LIST] i decided to use fstream for this code and i was able to view all records and add records at the … |
The End.