49,757 Topics
| |
[CODE] int x; while(cin>>x) { cout<<"Yes"<<endl; } int y; while(cin>>y) { cout<<"Yes again"<<endl; } [/CODE] What I expected to happen is,that as long as I entered a number for x(in line 2)that block should be run and "Yes" must be printed. To get out of the 1st while loop I … | |
Hello everyone, I have c++ function whose the only argument is an array. Also I have a matrix. How can I pass say third column of this matrix as a array into the function without creating a mediated array in the loop. Is there c++ analogue of M(:,3) existing in … | |
Hey there, i have created a dll that creates timesignatures, the source code is as follows... [CODE]#include "timestamp.h" BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) { return TRUE; } DLL_EXPORT char* CreateTimestamp(void) { time_t now; struct tm *ts; static char buf[80]; now = time(0); ts = localtime(&now); strftime(buf, … | |
I have this code which do some matrix operation. It can be run on Microsoft Visual c++ 6.0 but i got problem when run it using Dev C++ 4.9.9.2.. it says, [COLOR="Red"]main must return and int[/COLOR] Can somebody help me? [CODE]// FDduct.cpp , finite difference. method. for duct #include <stdlib.h> … | |
I've been playing around with c++ a bit, and made a "encrypt"-"decrypt" thing. Just basically taking the int value of the letters and adding x to them - becomming a new character/letter. This is the code where it asks the user for an input: [CODE] void decryptonise() { string text2; … | |
Hi Guys, Need a bit of advice, I developing a GUI of a system which was designed as a console application. With few options in visual studio like windows forms (VB.NET), MFC and wxwidgets am not sure as to what would be appropriate to use and plus I have very … | |
Hi. I need to print a btree, and instead of coding a method for draw it, I want to use graphviz. Have anyone of you used before? How can embed graphviz into my project without make the user do anything manually? There are some examples in the web, but they … | |
Can anyone help me with external direct merge sorting? Here is my code [code=cpp] #include<iostream> #include<conio.h> #include<stdio.h> using namespace std; int GetKey(char infoLine[30]) //Getting sorting key { char temps[30]; strcpy(temps,infoLine); return atoi(strtok(temps," ")); //returns first number in a line } void DirectMerge(char fileName[20]) { FILE* FTS; //file wich will be … | |
Hi im looking to create a structured string in c++ the structure would be simular to a guid or uuid but programatically without using the guid apis, could you help me acheive this Thanks, Nathaniel Blackburn | |
My program is having an error on the following lines w/ red font. It says invalid types 'int[int]' for array subscript... pls help I'm not sure how to solve this. [COLOR="Green"]*********This is actually how my program works********* Read in a line of text and output the number of words in … | |
Im trying to implement a btree. I don't have any error in compiling, but when I run my code I have some weird runtime error. It says something like: MALLOC c:3096: sYsmalloc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size … | |
| I am trying to make the following program. SUM=1+1/2+1/3+1/4+1/5....1/n n should be input by the programmer. I thought that using [CODE]for[/CODE] would work, but it only gives me a series of 1+1 1+2 1+3,etc. What I wish to get is the series itself and the total addition of it. Any … |
I have an array that I want to be able to access in two separate methods and also in other files. To do this I have had to declare it as Static, can this be done another way? because I don't want to declare it as static This is an … | |
I'm working on a Chat program using a server and clients. I have all of that working fine but now I'm trying to setup accounts for the server to use and I'm having problems with checking if the password entered on login matches the password for the account. When the … | |
| Not so long ago firstPerson started what was a series of competition questions for the users. It was fun so I was thinking of doing another. I've always kind of been interested in A.I so I thought that would be a good place to start.This is probably a more advanced … |
I want to make a program, that will run every time I turn on the computer. Like Skype.. or Anti Virus programs. How would I do that? | |
I wrote this: [CODE] #include <stdlib.h> // system pause //#inlcude <ctype.h> // for toupper() #include <iostream> // input output #include <iomanip> // setw() #include <string> //#include <algorithm> //#include <iomanip> // for setw() and right-aligned //#include <math.h> // for pow() using namespace std; int main() { /* char alpha [26]; char … | |
Please consider a beginner/intermediate question for which searching Google has provided me no results. I am attempting to write a program that compiles a script program into an assembly language module that I will then link to the main C++ program using Visual Studio. How is it possible for a … | |
I am making a program and I want to be able to determine the refresh rate of the monitor somehow (to limit an fps cap). I am using windows API. Is there anyway to access this? | |
Hi all, I am currently working with some c++ code on an ARM processor. The issue i am having is that when my application hits a segfault i am unable to get any information as to what caused it. My dev machine is ubuntu 10.04 LTS and i am using … | |
Hello everyone, I am trying to call gnuplot in c++ code using pipe in linux. There is no errors during compilation, building and excecution. However, window with the plot does not appear. Below is the code. [CODE] FILE* Gplt = popen("gnuplot -persist","w"); fprintf(Gplt,"plot '/home/mk/nh1.dat' using 100 with lines"); pclose(Gplt); [/CODE] … | |
I trying compile my program but it all time write error: stray '\32 ' in program , I have there some graphics instruction, I think its error with directx but Im not surre. If somebody want i can send him my source. | |
Good Morning, I am trying to create 2 arrays out of a list. Here is the code that I use: [CODE]int* move_x= new int[10]; int* move_y=new int[10]; void D::printpath(){ int i=0; list<state>::iterator iter2; for(iter2=path.begin(); iter2 != path.end(); iter2++) { cout<<"["<<iter2->x<<" , "<<iter2->y<<"]"; move_x[i]=iter2->x; move_y[i]=iter2->y; i=i+1; } }[/CODE] It gives an … | |
Hi, I have found it hard to search for the solution, so as my last resource I'd like to show my problem to you. It basically comes down to that I have an array, a dynamic one. Each index of that array holds a set of coordinates (how many, I … | |
I'm a new at C++ and need some help with this code. I searched but maybe because I'm not familiar with the correct vocabulary for C++, I couldnt' find an answer for this. What I'm trying to do is pass a string into a function that is looking for an … | |
I am trying to get to the "Wireless Network Connection" which we can normally get to by right clicking on that pc icon in the system tray & selecting the "View Available Wireless Networks" option. Is it possible to bring up that window through code using Windows SDK? I tried … | |
Hi there, I am writing a program that is taking a number and finding its cube roots and then prints out whether the result is an odd or an even number. I have written the following code but for some reasons it is not giving me the right answer. Could … | |
I have a union named un. I have a un* named up that is the address of a un named u1 (bear with me). The pointer works fine, but I can't pass it to a function. Any alternatives? Here is some code to illustrate (please tell me if there is … | |
Hi everyone! I wrote code for the progress bar but the thing is that it is just an empty bar and nothing goes on. So how can make it update? [CODE] #include <windows.h> #include <commctrl.h> #include "Resource.h" //--------------------------------------------------------------------------- RECT rcClient; HWND hWnd; HWND hProgress; HWND hDlg; HINSTANCE hInst; int pb_pos; … | |
How can I detect a palindrome as complicated as "A man, a plan, a canal, Panama!" without using erase() and just ignore the spaces and punctuations? The current version is: [CODE] #include <stdlib.h> // system pause //#inlcude <ctype.h> // for toupper() #include <iostream> // input output #include <string> //#include <algorithm> … |
The End.