49,761 Topics

Member Avatar for
Member Avatar for SandraM

Hi! I´m newbie in C++ Code and JNI, so i have a big problem and i can´t found a solution. My question is: Is possible to call a Jni method in a normal ,method, so: I have in my c++ class, two method: void CVentanasDlg::OnButtonStart(){ printf("OnButtonStart"); } JNIEXPORT void JNICALL …

Member Avatar for SandraM
0
105
Member Avatar for MareoRaft

What happens when you set an int or double value to less than the minimum? I need my program to recognize when a number is smaller then the minimum, and then set the value to equal the minimum instead. This behavior is not the default... [CODE]#include <iostream> using namespace std; …

Member Avatar for mrnutty
0
135
Member Avatar for apanimesh061

I do not know how to compile a visual C++ project using makefile ! I am trying to build a boot loader using C++ and assembly. This is the list if the constituent files in the project: start.asm //this is the beginning bootMain.cpp //main function displayScreen.cpp //clears th screen buffer …

0
57
Member Avatar for RAIMI

hi i want to change the static table to a dynamic table using pointer what should i change in this case ? [CODE] #include <iostream> #include <fstream> #include <string> #include <math.h> using namespace std; int i ,j , l , k ,x ; float b; const int maxElements = 10000; …

Member Avatar for Narue
0
577
Member Avatar for RAIMI

I was trying to write a program . But when i run it i have this error message this application has requested the runtime to terminate it in an unusual way

Member Avatar for RAIMI
0
297
Member Avatar for vinothcv

write a program that can be used to assign and book seats for a commercial cinema. The cinema has 16 rows, with 20 seats in each row. The seats at the mid-column (number 5 to 15) of the last 2 rows closest to the doors (row A and B) are …

Member Avatar for Salem
-1
515
Member Avatar for salah_saleh

I was reading a book and i faced an issue here [CODE]39 template< typename NODETYPE > 40 void Tree< NODETYPE >::insertNode( const NODETYPE &value ) 41 { 42 insertNodeHelper( &rootPtr, value ); 43 } // end function insertNode 44 45 // utility function called by insertNode; receives a pointer 46 …

Member Avatar for salah_saleh
0
153
Member Avatar for rayden150

I tried to store several data an cant achieve it: [CODE] #include <iostream> #include <string.h> #include <stdlib.h.> #include <stdio.h> #include "estructura.h" void guardar_cliente(cliente x) { FILE*f; f= fopen("data.txt", "w"); fwrite(&x, sizeof(x), 1, f); fclose(f); } [/CODE] I dont know whats wrong im using another cpp file and a header file …

Member Avatar for mike_2000_17
0
252
Member Avatar for bimoweemo

If i had to write a program with 10 different functions are you aloud to just make some functions templates and other functions initialized with data types like normal???

Member Avatar for bimoweemo
0
115
Member Avatar for massivefermion

I think its more than a year that I ask my questions about programming in this forum.Looks like its the time that I help a little too. So I wanna put my best here.I hope it'll help some one. Still I'll appreciate any suggestion. Another point,It was my first time …

Member Avatar for massivefermion
0
464
Member Avatar for MareoRaft

I want two function names that do the same thing, allowing the user to use whichever they prefer. For Vec a, i use "const" because a is never changed. Correct me if this is the wrong usage. For int n in operator|, i do NOT use "const" because n is …

Member Avatar for mike_2000_17
0
278
Member Avatar for madriceg

I am trying to use CString's LoadString function but it never retrieves the text from the string table. I ported the application from Visual Studio 6 to visual studio 2003. I looked all over the web but nothing is working. Somebody help me! And if you could be very specific. …

Member Avatar for madriceg
0
2K
Member Avatar for MareoRaft

I was advised that I should not import the std namespace in a header. Also, I should create my own namespace for my library (a header file I created with function in it). Why is it a bad idea to use the std namespace for my new functions? If all …

Member Avatar for mrnutty
0
145
Member Avatar for ahsanm45

Hi I am New to MFC actually i want to know that how to open New Window/ New Form From Main WIndow. Please Help me in that Thanks.

0
58
Member Avatar for MareoRaft

There is an error concerning lines 10-14. I had been using this code previously without errors. I'm not sure what I may have changed. The error is "invertMatrix.cpp:14: error: invalid use of incomplete type ‘struct std::stringstream’ /usr/include/c++/4.2.1/iosfwd:83: error: declaration of ‘struct std::stringstream’ " [CODE]#include <iostream> #include <vector> #include <cmath> using …

Member Avatar for mrnutty
0
2K
Member Avatar for bigdan182

I am writing some code to simulate a football tournament by comparing several teams on several parameters. I need to be able to knock out teams, edit some stats mid simulation, and be able to easily access individual teams data, what structure would I be best using? I had thought …

Member Avatar for mike_2000_17
0
217
Member Avatar for dark_sider_1

Hi there, I'm trying to teach a few students how to create a text adventure game. In the past, I've generally gone about the route of using nested if-statements because it seems a bit easier to visualize. Here's what one has done in the past, and ignore the crazy code-formatting …

Member Avatar for dark_sider_1
0
215
Member Avatar for ztdep

Dear friends: I use the find algorithm in STL to find a term in the vector<string>, but the find only return the iterator, how to return the index number of the term. Regards

Member Avatar for Insensus
0
66
Member Avatar for Jsplinter

I want to iterate through a list of objects, then erase all objects from the list which meet a certain criteria. Here is an example using int type as my object: [CODE] list<int> m_list; // Fill list with int values... // Find ints == 4 and erase them auto it …

Member Avatar for Narue
0
229
Member Avatar for tikoti

Hi all! I have a little problem here, I would like the width function in cout applied to all the sucesive outputs. However, it is only applied to the next output only, I mean, with this code I get 0:00:10:20:30:4 1:01:11:21:31:4 2:02:12:22:32:4 3:03:13:23:33:4 4:04:14:24:34:4 5:05:15:25:35:4 6:06:16:26:36:4 7:07:17:27:37:4 8:08:18:28:38:4 9:09:19:29:39:4 and …

Member Avatar for tikoti
0
2K
Member Avatar for Mona Ali

its my code pleas tell me y error occur in it. impex.h file [CODE]#ifndef IMPEX1_H #define IMPEX1_H enum shapetype {Point=1,Polyline=3,Polygon=5}; struct pointD { double x; double y; }; struct item { int id; list<pointD>coordinates; shapetype type; }; class impex { public: impex(); void savekml(list<item>); private: }; #endif .cpp file #include<iostream.h> …

Member Avatar for Mona Ali
0
207
Member Avatar for shadowscape

Hello, i was wondering how you would create a file association in c++ with the registry, in lua it would be something like this... [CODE] function File.SetAssociation(Ext, Exe, Icon, Long) local cKey = Long; Registry.SetValue(HKEY_CLASSES_ROOT, Ext, "", Key); Registry.SetValue(HKEY_CLASSES_ROOT, Key, "", Long); Registry.SetValue(HKEY_CLASSES_ROOT, Key.."\\DefaultIcon","",Icon..",0"); Registry.SetValue(HKEY_CLASSES_ROOT, Key.."\\shell\\open\\command", "", "\""..Exe.."\" \"%1\""); end …

Member Avatar for shadowscape
0
162
Member Avatar for SoSlow

.the program should use singly linked list of records.It should print he original directory then make some insertion and deletions then print the final directory. it should follow the steps 1. input initial listings such as name, address, and phone number. 2. input update records such as 'I' for insert, …

Member Avatar for Salem
0
317
Member Avatar for DotNetUser

I launch 2 programs within my application with PROGRAMNAME->Show. Let's call them Prog1 and Prog2. I have a dummy form that I use Application::Run to keep the software running. When 1 of the program closes, I call Application::Exit to shut down the application. This doesn't allow the other program to …

Member Avatar for pixma
0
221
Member Avatar for mark_6

i need a code for this!! Z asterisk pattern!! plsssssssss The program forms the letter Z by printing n input character symbols on the upper line, n input character symbols on the lower line, and n input character symbols on the diagonal line. If the value of n is less …

Member Avatar for sumant mahadik
-1
1K
Member Avatar for Joemeister

I'm new to C++ and here's a simple assignment. I'm not sure how to pull this off... ANY help will be appreciated . Here's the code for the assignment... You have to implement a function called approachPi that takes no parameters, and has the return type double. This function returns …

Member Avatar for Tellalca
0
184
Member Avatar for newbee234

Which of the following are valid function prototypes? x one(int a, int b); int thisone(char x); char another(int a, b); double yetanother; void thelastone(); void (function1) void; void function2(void) void function3(n, x, a, b); x void finction4(int n, float, char c); x void function5(int, a, int n); Which of the …

Member Avatar for NathanOliver
0
216
Member Avatar for daviddoria

I typically make a Types.h to define all of my types in and then include that in all of my project files. I haven't ever seen this anywhere though, so I assume it is "bad/wrong". The situation is often like this: Consider a class Gardener that needs to know type …

Member Avatar for mike_2000_17
0
131
Member Avatar for dyingatmidnight

Hello, I have been tasked with writing a test application to convert between geographic coordinate systems. Now math is not my strong suit but I was assured I wouldn't actually have to do any of the calculations since the formulas are provided. The trouble is trying to get the lengthy …

Member Avatar for dyingatmidnight
0
2K
Member Avatar for dilequeno

I have a large data base that looks like the following: Energy position 5.639792 1.36 4.844813 1.89 4.809105 2.33 3.954150 2.69 2.924234 3.42 1.532669 4.50 0.000000 5.63 The actual data contains thousands of rows. The first column of the data is the particle energy and second column is the particle …

Member Avatar for TrustyTony
0
292

The End.