49,761 Topics

Member Avatar for
Member Avatar for cretaros

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

Member Avatar for nmaillet
0
386
Member Avatar for MareoRaft

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 …

Member Avatar for MareoRaft
0
534
Member Avatar for spitfire5295

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]

Member Avatar for Arbus
0
131
Member Avatar for Labdabeta

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, …

Member Avatar for Labdabeta
0
153
Member Avatar for kaushik4study

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:\ …

0
41
Member Avatar for theguitarist

[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 …

Member Avatar for theguitarist
0
2K
Member Avatar for Freude

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 …

Member Avatar for mike_2000_17
0
186
Member Avatar for shadowscape

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, …

Member Avatar for mike_2000_17
0
218
Member Avatar for lili.edryana

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> …

Member Avatar for Ancient Dragon
0
319
Member Avatar for sha11e

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; …

Member Avatar for NathanOliver
0
654
Member Avatar for rEhSi_123

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 …

Member Avatar for rEhSi_123
0
153
Member Avatar for montjoile

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 …

Member Avatar for gusano79
0
122
Member Avatar for Troilk

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 …

Member Avatar for nezachem
0
305
Member Avatar for shadowscape

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

Member Avatar for L7Sqr
0
987
Member Avatar for king03

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 …

Member Avatar for Arbus
0
8K
Member Avatar for montjoile

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 …

Member Avatar for montjoile
0
359
Member Avatar for Raim

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 …

Member Avatar for Raim
0
159
Member Avatar for highlite

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 …

Member Avatar for highlite
0
90
Member Avatar for Ertzel

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 …

Member Avatar for Ertzel
0
145
Member Avatar for iamthwee

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 …

Member Avatar for pseudorandom21
0
172
Member Avatar for sergent

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?

Member Avatar for kerp
0
129
Member Avatar for henrimontreal

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 …

Member Avatar for mike_2000_17
0
156
Member Avatar for Seaboot

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 …

Member Avatar for Seaboot
0
175
Member Avatar for Labdabeta

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?

Member Avatar for Labdabeta
0
932
Member Avatar for Kanoisa

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 …

Member Avatar for Kanoisa
0
385
Member Avatar for Freude

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] …

Member Avatar for Freude
0
203
Member Avatar for hezechiel

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.

Member Avatar for nmepntgrm
0
1K
Member Avatar for Ninjah

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 …

Member Avatar for Ninjah
0
151
Member Avatar for Ragoune

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 …

Member Avatar for LevyDee
0
131
Member Avatar for Spillman

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 …

Member Avatar for Spillman
0
235

The End.