48,985 Topics

Member Avatar for
Member Avatar for babalonas

How do I return to start (int main) in c++ example: int main() std::cout << "Haha, this is a loop"; (what will I type to make it go back to start and repeat itself??)

Member Avatar for mrnutty
0
48
Member Avatar for wesselnaude

Trying to write a very simple function that boxes in a hello world print out. I have been stuck here for hours now and would appreciate some help as the frustration is killing me. The print out should look like this. ////////////////////// / Hello World / / Hello World / …

Member Avatar for Ancient Dragon
0
97
Member Avatar for gastonci

very simple, is there any speed or memory diference beetwen this two whiles? [CODE] int x = 0, y = 0; while(x < size) { y++; array[x] = array[y]; x++; } [/CODE] and [CODE] int x = 0; while(x < size) { array[x] = array[x++]; } [/CODE]

Member Avatar for gastonci
0
82
Member Avatar for group256

Hi everyone, I'm writing a code to get local ip address and send it to a server. I'm doing [B]socket programming[/B] and I'm trying to get Ip address of my machine, and send it to socket server. In other words, Let's say my ip address (which is the client), is …

0
73
Member Avatar for ladies5235

can anyone help me with my assignment about sequential access file?? i have attach 2 file..its about my assignment question..

Member Avatar for ladies5235
-2
130
Member Avatar for goulda660

I have been trying to write this program for this class that I'm in. The main objective is to make it able to save drivers to a file and then just be able to look up the drivers and then save them back to the file. I thought that if …

Member Avatar for daviddoria
0
205
Member Avatar for Tellalca

Hello everyone, i was just trying something when i got the error. I debugged and it says string password <Bad Ptr> and that password string have more than lets say 100000 childs of characters in it. I used the string::resize() member function but it doesnt seemed to solve the problem. …

Member Avatar for Tellalca
0
183
Member Avatar for macobex

I've just learned how to use vectors. I'm thinking about, what is the best way to create a vector, IF you do not know its initial size. Here are some of my options. 1.) This is the simplest I think, but is there any memory issue about this technique? [CODE] …

Member Avatar for n.utiu
0
133
Member Avatar for n.utiu

I have been recently experimenting with functors and tried o make my own one, inheriting from unary_operator, but I get some errors. [CODE] template <typename T, int intN = 0> class cIsBad : public unary_function <T, bool> { public: bool operator() (const T& tParameter) const { return tParameter == intN; …

Member Avatar for n.utiu
0
107
Member Avatar for karolik

So I have a program that reads data/text files, with 1 number on each line and makes a binary search tree from it. When i insert a node, there should be two data variables updated, searchcost and key.. Key being the actual number of the element, and the searchcost is …

Member Avatar for karolik
0
132
Member Avatar for tarheelfan_08

Hey guys I am trying to do some work with exception handling and I had to create and array with 100 elements in the main to hold cars in inventory, and create and int numCars to hold number of created cars. Then I had to create a for loop that …

Member Avatar for tarheelfan_08
0
251
Member Avatar for tjlee87

Hi, I have trouble with the "enqueue" section of this code, can anyone here find the fault within my code. I've been working on this for over 15+ hrs and I can't not find what I am doing wrong here. If there is anything else I need to provide, I'll …

Member Avatar for tjlee87
0
108
Member Avatar for Asheem

The program needs to read a file, in which position are mentioned in form of 0 and 1, and location (i,j), of the robot, who has to go the end point has to, generate numbers, randomly, BUT ALSO STORE THOSE LOCATIONS SO THAT THE ROBOT DON'T GOES TO THE SAME …

Member Avatar for WaltP
0
123
Member Avatar for Asheem

The program needs to read a file, in which position are mentioned in form of 0 and 1, and location (i,j), of the robot, who has to go the end point has to, generate numbers, randomly, BUT ALSO STORE THOSE LOCATIONS SO THAT THE ROBOT DON'T GOES TO THE SAME …

Member Avatar for WaltP
0
176
Member Avatar for lawyf

Hey all, I have manage to create a program which sniff and response to the snmp command returning the default value to it various parameter. However when the user will to set a new value to the parameter, instead of displaying the new value the program response with the default …

0
47
Member Avatar for Frederick2

Will an int in C/C++ now be 8 bytes instead of 4? printf("sizeof(int) = %u\n", sizeof(int)); sizeof(int) = 8 In DOS it was 2 afterrall. And what about doubles? Will they be 16 bytes? Maybe call them 'fourples'... I really don't know. Me and my employeer are stuck in 32 …

0
62
Member Avatar for Martje

Hey all, how do i retrieve the names(string) of all the cd drives and usb drives available? for example if my cd/usb is named "Pencil( D: )" i want the name "Pencil" to be retrieved. Thanks in advanced.

0
46
Member Avatar for JohnPhilipps

Good evening, I have been working with derived classes and what could seem like an easy problem has had me look into it for hours. [U]My error message:[/U] Square.h(14) : error C2512: 'Rectangle' : no appropriate default constructor available Everything works well if I don't use my derived class "Square.h" …

Member Avatar for JohnPhilipps
0
194
Member Avatar for timbomo

I cant figure out why this D::D:: is coming up when i generate a random number. idk i looked at other pages and the code looks fine . [CODE] int roll_hold( char answer1, char answer2) { int numb_on_dice1,numb_on_dice2,play1, play2,next_player,play1_total, play2_total; char f,s;// first and second player. cout<< " Would you …

Member Avatar for timbomo
-1
91
Member Avatar for pearle

Suppose I have something like [CODE]char *threeDays[3] = {"Monday","Tuesday","Wednesday"};[/CODE] and I wanted to extract the first letter of each string and create another string using those letters. How would I go about doing it? I tried [CODE]char str[4]; strcpy(str,*(threeDays+1)); strcat(str,*(threeDays+2));[/CODE] but that gives me "TuesdayWednesday". I just want a string …

Member Avatar for pearle
0
1K
Member Avatar for Jaxzen

I need to turn the characters in a string that's generated from a data file into *'s and make it visible to the user. [code] #include <iostream> #include <fstream> #include <string> #include <cstdlib> #include <ctime> using namespace std; int main() { int numph; //First number in .dat file saying how …

Member Avatar for WaltP
0
142
Member Avatar for ahmed hefnawy

peace up on u everyone.. i wanna make a program in c++ include to make more than one matrix and i can make all calculations like + * - / on them like multiply 2 matrices ........... and i can save the matrix in program and i can Retrieves it …

Member Avatar for WaltP
0
71
Member Avatar for timbomo

how do i return to another part of the program like the begining [CODE] if ( letter=='y') { return letter; }[/CODE] i want it to return back to a prototype [CODE] int roll_hold( char answer1, char answer2)[/CODE]

Member Avatar for Sumyungi
0
106
Member Avatar for Jaxzen

My code is supposed to take numbers from an .txt file, assign them variables, print out the numbers and THEN if the number is less than 25, add them up according to parity. So, if the list of numbers is 1,2,3,4,5 It'll output: 1 2 3 4 5 Sum of …

Member Avatar for Lerner
0
926
Member Avatar for apo

Hi, here is the thing, I'm trying to make my university grading table on C++, when i fill in the grades it should tell me what i have accumulate. the thing is that when i insert the text grades it shows a zero when i click the buttom. the math …

Member Avatar for apo
0
290
Member Avatar for rawan_22

Hi all, Please I want a help, I used the mouse hook and I want to get the selected text in a windowand the title of the window. can anyone help me how to do this ? What API's can help me and get the text ? I using c++ …

0
52
Member Avatar for some

Here is my code, I am trying to make a smaller version of a chatterbot like Eliza. Anyways here it is.[CODE]#include <cstdlib> #include <iostream> #include <cstring> #include <stdio.h> #include <string.h> #include <string> #include <windows.h> #include <fstream> #include <tchar.h> // a few global variables char str[50]; // this one is for …

Member Avatar for some
0
134
Member Avatar for Talguy

I am trying to draw a gradient in a rectangle using cairomm. I found the code below which helped a lot. My problem is I want to turn this rectangle into a progress bar. Is there a way to modify the code so that it at a certain percentage of …

0
68
Member Avatar for Alicito

Hello Friends I'm facing a problem and I can't figure out what is the wrong ( it is [COLOR="Red"]a Run~Time~Error[/COLOR]) I have these two classes [CODE] // singly-linked list class to store integers #ifndef INT_LINKED_LIST #define INT_LINKED_LIST class IntSLLNode { public: int info; class IntSLLNode *next; IntSLLNode(int el, IntSLLNode *ptr …

Member Avatar for Alicito
0
98
Member Avatar for josolanes

I'm using [this website](http://stdcxx.apache.org/doc/stdlibug/33-3.html) as a reference and am modifying some code to (hopefully) have it work the way I'd like it to. I *think* I'm close, but since I have no experience with custom paramaterized output manipulators (and have limited experience with custom output manipulators even) I'm kind of …

Member Avatar for josolanes
0
342

The End.