49,761 Topics
| |
How to i implement loops to print the initialised word as foloows: Thanx in advance. p pr pro prog progr progra program programm programmi programmin programming programmin programmi programm program progra progr prog pro pr p | |
x.find() does not return the proper values for x.find('J'), x.find('K'), and x.find('.'). Do you know what could be the issue? It could possibly be x.substr() which is causing the issue. I want the variable q to be "q_J30_K5.txt". [CODE] #include <iostream> using namespace std; short ato( string number ){ return … | |
I am trying to figure out how to make that write out the keys i am typing. How can I accomplish this?[code]#include <windows.h> #include <stdio.h> main() { while(1){ for(short character=8;character<=222;character++) if(GetAsyncKeyState(character)==-32767) printf("%d : %c\n",character,character); };[/code] | |
I have reinstalled my compiler successfully (finally) and got right back to work. I have created a glModel class as follows: [CODE]class glModel { private: int numv; int numn; unsigned int model; unsigned int textu; unsigned int norma; float *vars; float *norm; public: glModel():numv(0),numn(0){vex=new float[1];tex=new float[1];nex=new float[1];} glModel& Vertex(float tx, … | |
Hi I am facing a problem while using function CreateInstanceFromAndUnwrap(....) in my program. Problem: I do have certain c# dll which i have to load in my c++/cli code.and after that i want to call certain function from that assembly. For example, I do have a dll(C#) in my C:\ … | |
[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 … |
The End.