51,593 Topics

Member Avatar for
Member Avatar for KAY111

Hi guys, I am stuck with this piece of code for a long time. The errors that come are: bfs.cc: In function 'void greedyMatch()': bfs.cc:9: error: expected initializer before '*' token The relevant code is [code=c] #define forallXNodes(u,G) \ for(arc *bfs_ee=(G.getSource())->firstOutArc(),arc *bfs_stopA=(G.getSource())->lastOutArc(),u=bfs_ee->head(); bfs_ee <= bfs_stopA;u = (++bfs_ee)->head()) #define forallYNodes(u,G) \ …

Member Avatar for KAY111
0
1K
Member Avatar for Stefano Mtangoo

Hi again, After a defeat in Linux in other post (which I'm still finding a way), I have decided to give a shot in windows. However it produces DLL fine and I can use LoadLibrary(). I need it to produce .a file for static linking. How do i do it? …

Member Avatar for Stefano Mtangoo
0
258
Member Avatar for bbman

Hey, I have just switched from C#, and in C# there was a way you could create an item (Example), and set parameters. [CODE] Example text = new Example(); Example.parameter = value; //etc [/CODE] I have searched the internet, and could not make any sense of it. Any help would …

Member Avatar for Fbody
0
123
Member Avatar for dansnyderECE

I'm trying to convert a disassembled Hex Dump to a SPIM friendly assembly file. This requires that I take lines like: [CODE] 004000f8 <_init>: 4000f8: 27bdffe8 addiu sp,sp,-24 4000fc: afbf0010 sw ra,16(sp) 400100: 0c100064 jal 400190 <call_gmon_start> 400104: 00000000 nop 400108: 0c100094 jal 400250 <frame_dummy> ... [/CODE] and make them: …

Member Avatar for nbaztec
0
149
Member Avatar for dansnyderECE

Is there a good way to determine the end of a a line in a text file? I need to find of end of a line in text because all text lines are of different length. I also have to store each word (separated by spaces) into a vector. [CODE] …

Member Avatar for nbaztec
0
247
Member Avatar for anu07

A question has been knocking my mind today,is it possible to convert a executable file back to its source code in c++??

Member Avatar for anu07
0
118
Member Avatar for YasaminKh

Hi everyone, Somewhere in my need i need to create strings like ( x,y,z ) with 0<x,y,z<N. I was trying to use 3 for loops but it didn't work. That's what i wrote: for(int i=0;i<N;i++){ for(int j=0;j<N;j++){ for(int k=0;k<N;k++){ string t="( "; t+=i; t+=","; t+=j; t+=","; t+=k; t+=" )"; } …

Member Avatar for YasaminKh
0
191
Member Avatar for mod666

hi! i have a class from which other classes are inhertited. I then create a function GetInput() & I want it to funtion for evry object inherited by MAIN. I don't want to create separate functions for each. Is there any way for it? Thank you.

Member Avatar for Fbody
0
113
Member Avatar for altXerror

i have a Header file that i will be using for multiple programs. this file specifies integers (its for my calculator programs). is it possible to have an integer value represented as AB if the two other integers are represented as A & B without getting a compiling error? EX. …

Member Avatar for mrnutty
0
159
Member Avatar for merse
Member Avatar for AkashL

This problem originates from a job interview which could be solved in C++ or C#. As far as I can remember it was to implement a queue that can be added to by multiple threads and accessed by multiple threads. I haven't tried it in C# yet although I think …

Member Avatar for Radical Edward
0
248
Member Avatar for moshe12007

i have in the Visual C# 3 options of database : 1. SQL SERVER (.sdf) 2. ACCESS (.mdf) 3. ADO.NET (.edmx) which database advisable to use??? *if you give me answer please give me tutorial\book\name of book. thanks.

Member Avatar for kvprajapati
0
174
Member Avatar for DelilahDemented

I'm working on a problem where I am trying to validate the user input to verify only digits have been used. I'm trying to use the ASCII code to do so, but I'm stuck. I would greatly appreciate any help that can be provided. Thank you in advance!!! *Delilah* [CODE]#include …

Member Avatar for Taywin
0
2K
Member Avatar for neknek

I downloaded OpenCV last Wednesday and tried to link it with DevC++ I followed the instructions found [URL="http://www.cypax.net/tutorials/opencv/index?language=en"]here[/URL] and I get the error cannot find -lhighgui ld returned 1 exit status I'm sure the code that I tried to compile is working because I previously compiled and ran that code …

Member Avatar for neknek
0
177
Member Avatar for bklearner

code not working [code=c++] #include<iostream> using namespace std; typedef struct node{ int data; struct node *next; struct node *previous; }mynode; mynode *head,*temp,*current,*tail; void add(int data); int main() { head=NULL; tail=NULL; add(1); cout<<"added 1"<<endl; add(2); add(3); add(4); } void add(int data) { temp=(mynode*)malloc(sizeof(mynode)); temp->next=NULL; temp->previous=NULL; if(head == NULL) { head=temp; tail …

Member Avatar for Taywin
0
148
Member Avatar for Galdzor

Hello I just started programming and managed to make some programs, but what I don't get is when I get these errors: Compiler: Default compiler Executing gcc.exe... gcc.exe "D:\Documents and Settings\Riikard\Desktop\Untitled1.c" -o "D:\Documents and Settings\Riikard\Desktop\Untitled1.exe" -g3 -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib" -g3 D:\Documents and Settings\Riikard\Desktop\Untitled1.c:1:20: iostream: No such file or directory D:\Documents and …

Member Avatar for nbaztec
0
110
Member Avatar for Mena samy

Hello every body I made a small prog. to click mouse , but when i tried to make it parallel using mpi it doesn't work can any body lead me where is the error [CODE]#include "mpi.h" #include <windows.h> #include <iostream> using namespace std; int main(int argc, char *argv[]) { int …

0
38
Member Avatar for allonline

I have met a proplem in correcting the following file and please submit to me by correcting the errores and if you can please help me in sorting and updating this file #include <iostream> #include<fstream> #include<string.h> using namespace std; struct gum { string nam,fnam,typ_item,nam_pack,coun_cons; int tin_no,reg_no,tot_item,tot_pack; float weigh; }; void …

Member Avatar for Taywin
0
149
Member Avatar for dansnyderECE

I'm searching a text document and replacing substrings with other substrings. So for instance: "ra,16([B]sp[/B])" with "ra,16([B]$sp[/B])" The issue I'm having is that say I have the following string: "sp,sp,24" How do I re-iteratively replace "sp" with "$sp" twice without getting: "$$sp,$sp,24" This is my code: [CODE] ... if ( …

Member Avatar for Taywin
0
104
Member Avatar for daviddoria

I've seen that a vector can be sorted using [code] vector<double> V; vector<int> Index; V.push_back(9); V.push_back(10); V.push_back(8); Index.push_back(0); Index.push_back(1); Index.push_back(2); sort(V.begin(), V.end()); [/code] If I want to sort Index according to how V was sorted, there is an optional third parameter to sort() that will do this. I don't understand …

Member Avatar for daviddoria
0
2K
Member Avatar for mybluehair

Hello. So the most I can tell you is i'm having serious trouble with my code of writing to a txt file. It's not that my code isn't working, it's that c++ is outputting WEIRD crap that makes no logic sense, doing things out of order, and just seriously screwing …

Member Avatar for nbaztec
0
407
Member Avatar for allonline

I met a problem in sorting a file containing astudents fistnane, secondname and GPA.if I sort the file using first name or lastname their Gpa will be miss placed please help me. the file is: kalayu haile 3.5 fikadu adisu 3.99 eyob assefa 3.25 getaneh allesew 3.75 fraol gezahegn 3.00 …

Member Avatar for peter_budo
0
342
Member Avatar for mohamedhassan

hi.. now i'm trying to use the openfiledialog in a gui app .. what i have done till now is that 1. open visual stdio 2008 2. select c++ project 3. select windows application project 4. drag the openfile dialog from tool box and drop it on the form .. …

Member Avatar for jonsca
0
129
Member Avatar for gameon

My question may be funny but i want a right direction so i am posting it. I know fundamentals of c and c++ and i want to go ahead in it. I heard about windows and system programing but i am confused that app like antivirus, process explorer, anti spyware …

Member Avatar for nbaztec
0
97
Member Avatar for adityats2020

Is it possible to write a code that prints 'its own code' when executed? Just a thought.

Member Avatar for nbaztec
0
126
Member Avatar for samaru

If you're doing programs for academic reasons, this is a good site to go for C++ information. Good for snippets. Used it a lot through classes. http://www.mvhs.net/~rkrane/clecs/

Member Avatar for kvprajapati
0
1K
Member Avatar for playagain

Please help me how to use clrscr(); and gotoxy(); functions in other C Compilers?

Member Avatar for karrl
0
317
Member Avatar for TomB1988

Hi there, The program in hand must retrieve a bunch of data from an SQL Database (currently stored in a DataTable), fiddle around with the data, and then upload the changed data to the same SQL database. Everything works fine at the mo apart from the final bit, uploading to …

Member Avatar for microdata
0
144
Member Avatar for bushman_IL

Hello, I am trying to send an object over a socket using C#. I originally used a memorystream and binaryformatter, but to do this I need to include a reference from program1 to program2. I don't want to have a reference, so I just want to be able to transform …

Member Avatar for bushman_IL
0
1K
Member Avatar for argio

Alright guys I have a question. I am trying to write a custom data type. Let me explain a little further. I'll start out at the base. te_char (you don't really have to worry about this. >char c_char >rgb color te_word (weird part) >int type (based on an enumeration >vector …

Member Avatar for Radical Edward
0
160
Member Avatar for FudgeCoder

Here is the code: [CODE]#include <cstdlib> #include <iostream> using namespace std; //Declare function int triangle(int num); int main() { int n; cout<<"Enter a number and press RETURN: "; cin>> n; cout<<"Function returned:"<<triangle(n)<<endl; return 0; } //define function int triangle(int n){ int i; int sum=0; for(i=1; i<=n; i++) sum=sum+i; return sum; …

Member Avatar for Taywin
0
156
Member Avatar for Galdzor

Hello, Ive started to programming a few days ago, I'm totally new never done it before. Ive read through the internet for some knowledge about programming. I used the program code blocks to program yesterday but I got some errors in it so I uninstalled it, it wasnt really errors …

Member Avatar for Kanoisa
0
181
Member Avatar for Buolbear4444

I wrote a console calculator application in Microsoft Visual C++ Express 2010 and built it as release. It runs fine on my computer but when I moved it to another it said it needed a certain .dll which was not previously, and said reinstalling the application may fix the problem, …

Member Avatar for venomxxl
0
170
Member Avatar for vbx_wx
Member Avatar for Radical Edward
0
130
Member Avatar for anita_jojo20

plz help meeeeeee my program include 5 people that if choise 1-wrte name people 2- ACCOUNT 3-SUPPLY account and with add 1 people choise 1-SUPPLY account 2-update of account plz i can not write plz how i write this program :'(

Member Avatar for griswolf
0
183
Member Avatar for eggmatters

Hi all, My cpp is rusty as all get out and I'm wondering why this doesn't seem to work. I've basically created a .cpp file with all of the structs and lower level data types in it. One of these is an enumerated type. The file. structs.cpp is as follows: …

Member Avatar for eggmatters
0
148
Member Avatar for Jeronim

Topic title is not the best but nvm I have been looking for this on internet but cant it find anything useful. [CODE]#include <windows.h> void main() { ShellExecute(NULL, "open", "http://dreamincode.net", NULL, NULL, SW_SHOWNORMAL); }[/CODE] This is function which I have found on net to open URL, problem of this function …

Member Avatar for Jeronim
0
1K
Member Avatar for bubacke

hi all, i tried this code, but it doesnt work, it says vector subscript out of range: (sorry, i just dont understand how to correctly post code, if someone could tell me, please?) #include <iostream> #include <vector> using namespace std; vector<int> v; v.push_back(1); v.push_back(2); if (2 < v.size() && v[2] …

Member Avatar for bubacke
0
132
Member Avatar for jimJohnson

Here are my instructions and I think I have it done but I just realized I need to use memory mapped IO. I am reading over the book and doing research on it but just dont know how to change it and my deadline is Friday. Can someone take a …

Member Avatar for Taywin
0
181
Member Avatar for moshe12007

i dont know how to read from database SQL. i try this : [CODE] string sql = "Select * from Table1 "; DataSet ds = new DataSet(); string connStr = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True"; SqlConnection conn = new SqlConnection(connStr); SqlCommand cmd = new SqlCommand(sql, conn); conn.Open(); SqlDataAdapter adapter = new …

Member Avatar for nick.crane
0
99
Member Avatar for dhruv_arora

I made a c++ program. I used cin.getline() function so I could input a string from the user. But when I run the program it does not input anything nor gives me a change to input anything instead it goes to the next statemement. For eg. this is my program …

Member Avatar for dhruv_arora
0
114
Member Avatar for dhruv_arora
Member Avatar for ShortYute

I'm knew to C++ and I always seem to have a problem but all I want to do is to pass an Object to a function by reference.. Thanks in advance Oh I user boost for directories, paths and files... Also I use c strings for UserName and password as …

Member Avatar for ShortYute
0
922
Member Avatar for macla
Member Avatar for nbaztec
0
51
Member Avatar for Utte

Hello. I have a little problem with using a .dll in my visual studio 2008 project. The dll is created by bjam. The guide i followed was: [URL="http://www.rasterbar.com/products/libtorrent/building.html"]http://www.rasterbar.com/products/libtorrent/building.html[/URL] There is also a vs 2008 guide but i do not know enough about visual studio to follow it. [URL="http://code.rasterbar.com/libtorrent/wiki/BuildVS2008"]http://code.rasterbar.com/libtorrent/wiki/BuildVS2008[/URL] Well i …

Member Avatar for darreno
0
266
Member Avatar for FudgeCoder

It won't let me build my project. It's just a simple one file thing since I am just learning. When I click build or debug it prints "Launch failed. Binary not found." What do I do? EDIT: I am on a mac.

Member Avatar for theABCasian
0
127
Member Avatar for mattloto

I need a way to communicate with other exe's. Almost like being able to call cout but to a exe, not the output stream. Both of the apps would be in c++. I know cout is for output stream, sstream is for any stream, fstream is for files, something like …

Member Avatar for mkvist
0
290
Member Avatar for Stefano Mtangoo

In simple terms, to write windows DLL I have to define DllMain and do switch stuffs and then export functions using __declspec(dllexport). If I'm right the question comes what about linux? I want to write it in ubuntu box and I'm stucked! How do Coding DLLs differ from .SO? Thanks!

Member Avatar for Stefano Mtangoo
0
145
Member Avatar for twc2102

I am using Visual C++ 2010 and created a CLR EXE debug project and wrote a function, which I am able to call from main in my program. If I take the exact same code and put it in a dll, then I get a compile error from the line …

Member Avatar for twc2102
0
2K
Member Avatar for Kanoisa

Hiya Im trying to make a few efficient maths classes that will optomise using SIMD SSE or SSE2 if the target CPU supports those SIMD variants or failing to support either use a normal CPU bound c++ version. The issue im having is that i want to have for example …

Member Avatar for StuXYZ
0
96

The End.