49,757 Topics

Member Avatar for
Member Avatar for thisischris

Say I have something like this [CODE] #include <iostream> #define ICOL 32 using namespace std; int main(int argc, char *argv[]) { ... [/CODE] Is there a way that I can change the value of that global variable within main? Simply saying ICOL = 300; does not work...

Member Avatar for mike_2000_17
0
175
Member Avatar for Gernicha

Hello everyone, I need to know how to import graphics into C++ (Not visual C++) such as .png, .jpg etc. Also, when I say import I don't mean how to make graphics with C++. Thank you everybody!!!! Regards, Gernicha

Member Avatar for mrnutty
0
36
Member Avatar for fiberoptik147

I am VERY novice and working on a school project in C++. I'm not sure where I've gone wrong here in this code. Any advice on why this is not working would be appreciated. Please, pretend like you are talking to someone who knows very little about programming so far. …

Member Avatar for sergent
0
205
Member Avatar for CodyOebel

I have an application in which is compiled on my win32 development machine, but I need this application to be windows 7, 64 bit compatible. How can I do this on my 32bit development machine?

Member Avatar for triumphost
0
115
Member Avatar for Rawrels

I'm attempting to copy a string out of a arbitrary position in a buffer. I can copy out the string but I'm left with a memory leak that I do not know how to solve. Is there a better way to do this; if not, how do I solve the …

Member Avatar for WhiZTiM
0
176
Member Avatar for lotsofsloths

Ok, im not that much of a geeky smart guy in C++, but i've got some skillz.. so im trying to make a [B]very[/B] [B]simple game[/B] that will randomize 1 number for the computer and 1 number for the person using the program and whomever(person or computer) gets the highest …

Member Avatar for ichigo_cool
-1
1K
Member Avatar for IamAuser

Hello all, here is the code I came up with for implementing a circular linked list. I get a segmentation fault when I create the list with just one node. With size > 1 circular list works fine! Im not sure but I think it may have something to do …

Member Avatar for IamAuser
0
269
Member Avatar for Labdabeta

I am having a lot of trouble getting the following to work and I think it is because of file issues: [CODE]int GetMinutes() { fstream file(FNAME); char num[101]; if (!file.is_open()) Error("FILE NOT OPEN!"); file.getline(num,100); file.close(); return atoi(num); } int main(int argc, char *argv[]) { LARGE_INTEGER timestart, timestop, tickspersecond; QueryPerformanceFrequency(&tickspersecond); QueryPerformanceCounter(&timestart); …

Member Avatar for WaltP
0
133
Member Avatar for amna masood

236.cpp(41): this line contains a '{' which has not yet been matched THE CODING IS: #include<iostream> #include<string> #include<conio.h> #include<IOMANIP> #include<fstream> //#include<cctype> //for toupper function using namespace std; class TESTstudent { string name[3]; string sir_name[3]; int roll_no[3]; int count; // FOR LIBRARY string book1[3]; string book2[3]; int dues[3]; int num_book[3]; int …

Member Avatar for amna masood
0
100
Member Avatar for goocreations

Hi all I'm stuck with this problem for a couple of weeks now, and my normal human brain can't tell me what's going wrong. I've created my own class, inheriting from QThread. Nothing weird in calling it: [CODE] MyThread *thread = new MyThread(); thread->start(); while(thread->isRunning) ; delete thread[/CODE]; I know …

Member Avatar for mike_2000_17
0
120
Member Avatar for helpplease234

Need a little help, I'm trying to run a program that asks the user to enter an integer between 1-50. If given a number between 1 and 50 then echo number then add all integer between 1 and integer entered if user enter an integer not between 1 and 50 …

Member Avatar for Fbody
0
297
Member Avatar for MagnetoM

I am attempting to use a different template and write in C++/CLI. The debug file isn't being created for some reason. If I misspell a keyword or enter errors I don't see any red squiggly lines. When I attempt to compile I can't because of an error. C1083: Cannot open …

Member Avatar for MagnetoM
0
98
Member Avatar for pdwivedi

Hi everybody, can someone please explain what is the difference between line A(10) and line B(11).why am i being able to access value of n without using de-referencing operator in first case? [CODE]void fun(void *n) { printf("\n n=%d ", n); } int main() { char nVal = 65; fun((int*)nVal); //-----A …

Member Avatar for mike_2000_17
0
603
Member Avatar for kumarmpk4u

I changed GetDOSEnvironment variable to GetEnvironmentStrings when convering a 16 bit code to a 32 bit one. I got the below error help to resolve the problem mfcs42d.lib(dllmodul.obj) : error LNK2005: __pRawDllMain already defined in SLSOCKET.OBJ Debug/slgsockd.dll : fatal error LNK1169: one or more multiply defined symbols found Error executing …

Member Avatar for Ancient Dragon
0
125
Member Avatar for pmark019

[CODE] #include <iostream> #include <sstream> using namespace std; int main() { int a, b; string s = "34:22"; istringstream ins; ins.str(s); ins >> a >> b; cout <<a <<b; } [/CODE] This is my code and I want to ignore the ":" in string s. The outpout should be 3422. …

Member Avatar for pmark019
0
1K
Member Avatar for yozzie

Alright - this is my conundrum. As a noob to C++ I am only in chapter 9 of my book, having just covered object oriented programs and the exciting world of vectors and arrays. I have an assignment that asks me to run a loop to get and calculate a …

Member Avatar for yozzie
0
2K
Member Avatar for JJmaster08

Using borlandc [CODE]#include <stdio.h> #include <conio.h> #include <dos.h> #include <stdlib.h> #include <iostream.h> void main() { clrscr(); char x1,x2,name,add,email,occupation; int age,cellno; printf("\tWelcome"); printf("\n\tto"); printf("\n\tVideo City"); printf("\nMembership Registration"); printf("\n\t\tA.New"); printf("\n\t\tB.Old"); printf("\nChoose:"); cin>>x1; clrscr(); { if((x1=='a')||(x1=='A')) { printf("\nRegistration Form"); printf("\nName:"); scanf("%s",&name); printf("\nAdd:"); scanf("%s",&add); printf("\nemail:"); scanf("%s",&email); printf("\nAge:"); scanf("%d",&age); printf("\nOccupation:"); scanf("%s",&occupation); printf("\nCell No:"); scanf("%d",&cellno); clrscr(); …

Member Avatar for jonsca
0
124
Member Avatar for littleleaf

This is a program for displaying image files. I downloaded this program template from Microsoft. I executed the program and open an image file to display, and everything seems to be working fine. However, when I continue to open another image file - which is different from the first one …

0
71
Member Avatar for Shaabangbang

Hello, I am trying to make a constant iterator data structure, I have a normal Iterator data structure done, but I'm a little stumped with the const iterators.. can you please point me in the right direction? This is my data structure for the iterators: [CODE] template <typename T> class …

Member Avatar for thekashyap
0
129
Member Avatar for karan_kanna

Write a program in c++ that read two files A.txt and B.txt, and find all words which are in file A.txt but not in file B.txt. Input: A file containing large text. The file may contain any number of words.

Member Avatar for csurfer
0
106
Member Avatar for tomtetlaw

I have 2 projects. I'm using VC++ 2010 express. The first is a static library which generates a lib file called stdlib.lib. The second is a dll project which links to stdlib.lib. When I try to compile, I get linker errors that say unresolved reference and they refer to functions …

Member Avatar for mitrmkar
0
168
Member Avatar for tometherton

OK I'll try to explain what I'm trying to do... I've got 16 numbers in an array and I want to find out the best way of adding any combination of these (it can be 2 of them, 5 of them or all of them) to get as close to …

Member Avatar for tometherton
0
106
Member Avatar for bigwhiteegg

first time using libcurl I'm trying to use it for a function that downloads a page's source code like this getHTML(string URL); but I do not understand the set up [URL="http://curl.haxx.se/libcurl/c/libcurl-tutorial.html"]libcurl[/URL] [QUOTE]There are many different ways to build C programs. This chapter will assume a UNIX-style build process. If you …

Member Avatar for vijayan121
0
243
Member Avatar for lochnessmonster

what is the difference in the 2? [CODE]class Log { private: // no members attributes public: void createLog( ); }; int main() { Log log1; log1.createLog(); }[/CODE] [CODE]class Log { private: // no members public: static void createLog( ); }; int main() { Log::createLog(); }[/CODE]

Member Avatar for thekashyap
0
107
Member Avatar for hawita

Hi could someone please helping in starting this program? I am not asking anyone to do my work for me i just want to know how i can start the program and steps to follow please( i am new to c++) thanks write a program that reads an n*n matrix …

Member Avatar for dkalita
0
128
Member Avatar for M3SSIAH

Hi, im trying to make my .dll program written in VC++ search for an aob(array of bytes) in its own process. It's supposed to retrieve the aob from a textbox, search for it and return an address. For example i type the following aob in the textbox = B8 ?? …

Member Avatar for M3SSIAH
0
291
Member Avatar for Pascode

Hi, Im new to c++ and this site but I have been reading it for the last few weeks to month. I have a problem with a battleship game im trying to finish. Basically I have the random and custom boards working, the function to prevent overlapping and placement off …

Member Avatar for Pascode
0
175
Member Avatar for seanman13579

I have to write a program to check for balanced HTML tags here is what i have so far. My problem is it is not working right. My stack implementation is fine, i believe my problem is when i am looping through the string ( lines58-70 I marked with comments …

Member Avatar for WaltP
0
2K
Member Avatar for plang007

[B]****Output[/B] There were 305 birds in this list. Species: Snow_Goose Number: 305 There were 567 birds in this list. Species: Canada_Goose Number: 567 There were 4 birds in this list. Species: Tundra_Swan Number: 4 There were 31 birds in this list. Species: Wood_Duck Number: 31 There were 60 birds in …

Member Avatar for plang007
0
238
Member Avatar for WolfShield

Hey everyone, I'm trying to figure out how to convert from an Integer or a Double into a string. I want a string variable to print out on a command line. Thanks for any help. - [B][I]WolfShield[/I][/B]

Member Avatar for rubberman
0
192

The End.