49,761 Topics
| |
Hi guys. There seems to be a lot of people on this forum who know what they are talking about. My question is simple. I'm fairly new to c++ and i have hit a brick wall. I'm trying to write a simple program that grabs 2 txt files and outputs … | |
I dont clearly understand bool functions. this lends problems to my current assignment in class where i have to write a program that involves a bool function that tests for letters in a string that the user inputs. Can anyone offer help to me? the whole code is slightly confusing … | |
hey , I'm trying to read a 24 bit bmp file but after reading the first pixel something goes wrong, any ideas? int i; FILE* f = fopen("Sample.bmp", "rb"); unsigned char info[54]; fread(info, sizeof(unsigned char), 54, f); // read the 54-byte header // extract image height and width from header … | |
Hi what are Macros used for in C++? i never heard this word in my entire life :D and what are `assert()` and `NDEBUG`? | |
i need your help to find c++ code for Clustering algorithm for energy efficiency in wireless sensor networks | |
I know that there's no solution book for C++ Primer 5th Edition by Stanley Lipmann but is there any on the web? Would appreciate any help on this. Thanks. | |
Hi , I have a small 2d array and I want to check if it exists in a bigger 2d array. I have coded it but I don't know what am I doing wrong cause even if exists it won't detect it. 2 arrays are PI and NPI. PI is … | |
This program hangs when I enter the number of vertices only..It does nothing..I am not able to figure out what's wrong with this.Please help #include<iostream> #include <list> using namespace std; // This class represents a directed graph using adjacency list representation class Graph { int V; // No. of vertices … | |
OK. I just don't understand what is the problem here. Here's the code .h file : #ifndef NVECTOR_H #define NVECTOR_H class Nvector { public: //Nvector(); Nvector(int Size = 0); void addElement(int a, int index); void getElement(int index); void push_me_back(int a); void push_me_front(int a); private: int *p_array; int velicina; int *resize_array(int … | |
int game() { int n; cout << "enter an odd number: "; cin >> n; int MagicSquare[n][n]; // It says that the expression must have a constant type? int newRow,newCol; int i = 0; int j = n / 2; for (int i = 0; i < n; i++) { … | |
heres the code that i use for put the form transparent: LONG style= GetWindowLong(hwnd, GWL_EXSTYLE); style=style | WS_EX_LAYERED; SetWindowLong(hwnd, GWL_EXSTYLE, style); SetLayeredWindowAttributes(hwnd, clrBackColor, NULL, LWA_COLORKEY); but i see problems :( the form and the controls are showed, but the mouse events are ignored. if i click on button or form, … | |
Hello, anyone can suggest me a simple lua wrapper with clean code? I want to call from c++ lua functions but I dont really get it.. I only know a little LUA and C++. Example lua function I have: Get the level: function Lv(a) local lv = GetChaAttr( a , … | |
I am a beginner, and want to know how can run the code in notepad with visual studio. I tried with a simple code by --<<All Program -->microsoft Visual --> visual Studio tools --> visual Studio command prompmt. The error is: ''fatal error C1083: cannot open source file: filename.cpp: No … | |
Hi! So, I made this code #include<iostream> #include<cstdlib> #include<pthread.h> using namespace std; const int m=6; const int n=5; const int s=5; const int r=8; const int num_thrd=3; class data{ public: int* A; int* B; int* C; int start; }; void* multiply(void* pod) { data* P=(data*)pod; for(int i=P->start;i<m;i+=num_thrd) { for(int j=0;j<r;j++) … | |
Hi i tried to test some new features of C++ 11 but how come Visual Studio doesn't support `constexpr`? i tried this simple function but it won't compile constexpr int multiply(int x, int y) { return x * y; } | |
Consider a stack module like (two files stack.h stack.cpp) which supports the these functions; void push (stack *, std::string); std::string & pop(stack &); bool isEmpty(stack &); std::string & top (stack *); I didnt understand this part what it means. Also I declared stack like; struct stack { … }; But … | |
Forgive me if this is somewhat basic. If have an array of 20 strings defined: char const commands[20][20] = {// each command string will have a maximum of 20 chars. "quit", "open", "save", "close" }; I want to test the command value to see what action should be taken. int … | |
| hi to all user i am new in file handling , i know file handling but not much , my instructor taught me that use binary search tree in a file to search key value ,key value(like any thing such that record can be easily make out and comparision can … |
I have a text file and i want to replace a word from a specific location. For example want to replace 5th word from 12th line of file. How i can do that? | |
Dear members please help me in understanding the control flow in the following code, thanks #include <iostream> class constructs #include <iostream> class constructs { char inp; public: void acceptCharacter() { cout<<"Enter a character: "; cin>>inp; if(inp>='A') //ASCII value of A = 65 if(intp<='Z') //ASCII value of Z = 90 cout<<endl<<"Uppercase"; … | |
how i plot the sensor(mpuc6050) coding in c++.and i want a program that show 2 sticks in dos screen... | |
Hi everybody. I hope nobody is working too hard. I am trying to figure out a way to use the peek() method of the stringstream class but looking more than one place forward. For example, if I use stringstream.peek() it will let me know the value one value ahead of … | |
Hello. Well, im a little confused as to what exactly the terms Data Abstraction and Data Encapsulation mean: This is what i read: [B]Data Abstraction[/B]:data abstraction is a process of representing the essential features without including implementation details. [B]Data Encapsulation:[/B]: Data encapsulation, also known as data hiding, is the mechanism … | |
Hi, I have been assigned to a system integration project. However, I do not understand part of the integration implementation arhitecture. For example, I have a passport scanner connected to a Windows Client application constructed in C++. The client application would going to pass the passport picture, name, address etc, … | |
Hi! Have anybody seen Scot Meyers' video on Universal references? In order for a reference to be "universal" two requirements should be fulfilled : 1)variable should have double ampersand after it's type : sometype&& 2) the type should be deduced . The second point is somewhat confusing to me: despite … | |
Hello, I need for my game inventory function a mysql query which checks the next available free slot id. example: I have item on slot 1, 2, 3 and 5. Slot 4,6,7,8,9 ... are free.. Now I need query which would get the number 4. Something like SELECT * FROM … | |
> This compiles but does not show me any results? Why #include <iostream> #include <cmath> using namespace std; void dist(int x1, int x2, int y1, int y2) { double r1 , r2 , d ; r1 = sqrt((x1*x1) + (y1*y1)); r2 = sqrt((x2*x2) + (y2*y2)); d = sqrt((x2 - x1)*(x2 … | |
void init1() { static int yrs = 1; cout << "The value of yrs is " << yrs << endl; yrs = yrs + 2; return; } void init2() { static int yrs; yrs = 1; cout << "The value of yrs is " << yrs << endl; yrs = … | |
#include <iostream> #include <cmath> using namespace std; double dist(int x1, int x2, int y1, int y2) { double r1 , r2 , d ; r1 = sqrt((x1*x1) + (y1*y1)); r2 = sqrt((x2*x2) + (y2*y2)); d = sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1)); cout << " … | |
> Write a C++ function named fracpart() that returns the fractional part of > any number passed to it. For example, if the number 256.879 is passed to fracpart(), the > number 0.879 should be returned. Have fracpart() call the whole() function you wrote in > Exercise 12. The number … |
The End.