49,761 Topics
| |
Ok what i'm trying to do in this program is first create an empty binary file of size 31 records. Records includes studid & gpa. and then I insert valid record into the binary file with h(k) = key% 29..and then read this binary file sequentially and write the records … | |
Hey guys, Below code isn't working as I expect it to do. I expect it to read all params when 6 are given, buuuuuuuuuuuut it only reads one, the rest remains zero. It does enter the case, but the stringstream buf seems empty. What am I doing wrong? [code=cpp] #include … | |
Is it possible to print anything on screen in C or C++ without using main().If yes please explain how? | |
how do i output solution in array form into a file where it can then be copied. | |
Hi to all I have ADT of the AVL TREE and I need to add some the function to create tree to family. I have logic error in my code.. my code work to find relationship between two nodes (e.g: a parent of b,a and b are Sibling and so … | |
I have been testing a C++ based SDK and now i have a few questions for you that i hope you will answer . 1. When passing objects between each other is it preffered to use references if not what then? 2. Is it good or bad to make a … | |
Hi I have the following function which read ASCII characters(separated by space) from a file and I want to print it out to the screen contents of the data.txt file are like this 70 97 104 97 100 [code=c++] void decode() { string str; string instr; ifstream inFile; cout<<endl; inFile.open("data.txt"); … | |
I get only Java,J2EE,.NET job requirements these days , just wondering how C/C++ jobs have vanished from it job market . Are you also observing the same in your country ? | |
The question: Get an integer value from the user to draw a cheassboard on the screen of that specified size. The black squares must be * and with any other chessboard there must always be a *(black square) in the bottom left corner. PLEASE NOTE: I'm very new to c++ … | |
Hello all, I am trying to read in the text file but it seems my code cannot read the text file which has tab space eg Mine only reads Sydney NewYork 1300 but It should read Sydney New York 1300 ( and the space between city name or number can … | |
Here is some code that I am trying to use. Why wouldn't this work the way I am assuming it should? here is a sample of vector<string> mine: *** *2* *1* so mine[1][1] = 2. [CODE=C++] // In a function that has passed in vector<string> &mine int dist[2000][100]; cout << … | |
greatings to all of you!! I start learning c++ and i getting a problem with the [B]ENTER[/B] key... i want to ignore it and i just know how. [code] do{ printf("\n"); printf(" A : Quadrado\n "); printf("B : Rectangulo \n"); printf(" C : Circulo\n"); printf(" D : Triangulo\n"); printf(" E … | |
Hello all, I was building a program which needs to output in alphabetical order and i got stuck. (Program reads in text file and then do dijkstra's shortest path) My output is fine except that it is not in alphabetical order.... can anyone help me with this??? here is my … | |
well i´m taking some classes on C++, but i have no idea what namespacing std means or why i use getch(); an to return 0 how do i know which libary is which like the iostream or conio and how do you make your program finish and restart agian i … | |
does anyone know how to make a c++ program that types what you tell it to in to a text field on a website. for example: cout << "Hello"; how do you get this to print in to a text field on a website? | |
[CODE]void slova(string datoteka){ ifstream coban; coban.open(datoteka.c_str()); string polje[200]; string linija; int brojac=0; while(!coban.eof()){ getline(coban,linija); polje[brojac]=linija; brojac++; } string rec=polje[1]; int brojac2=0; for(int i=0;i<rec.length();i++){brojac2++;} cout<<brojac2<<endl; if(rec[0]==rec[brojac2]){cout<<"same letters"<<endl;} else{cout<<"letters are not same"<<endl;} }[/CODE] This is my code, it should test if 1st and last letter in string are same, but i can't … | |
hey guys umm this might seem really stupid but for reasons i would rather leave unsaid i want to make an encryption program and by this i mean a program that will turn a string into numbers and funnel into a file then when selected take the contents of the … | |
In my previous posts, I asked about how to transform a part of a string into an integer. Narue kindly gave me the answer and I've implemented it into my code. Here is my code: [CODE] int main() { string line; string cmd; while (cmd!="quit") { cout << "Command: " … | |
Ok, searched a bit and found a few relevant posts, but they didn't directly address my problem, so here I am... Basically, I'm trying to write a program that will, hopefully, do the following things in sequential order: 1) Accept certain login credentials (user test, password 1234) and auto-login to … | |
hi all, I have a binary file, then I try to read them and show the value to the screen, but what I got is always -13108. I don't know why. Here is my code [code] #include <iostream> #include <fstream> using namespace std; void main() { std::fstream f_in, f_out; short … | |
im trying to write a cg pixel shader and just want to generate a random number too offset the colour of a pixel is there something i need to include, i tried using rand() but gave me errors thanks in advance | |
hey i have a int **grid; pointer which should read from a txt file a grid which is made up for 0's and 1's, how would i make my grid pointer only read in 1 int for each index of grid[0][i]? txt file contains height and weight of the grid … | |
hello all , im trying to read a text file and display its contents. While i got the code running and the output was displayed perfectly for sometime , i started getting Abort(core dump) error . Am i missing something here ? im using HP-UX. [code] #include <iostream.h> #include <fstream.h> … | |
Problem Statement: Dynamic memory allocation/reallocation of an Integer array. Detailed Description: Write a program in which you have to: 1. Dynamically allocate an array of integers. 2. Take array size as input from user and allocate memory according to this size. 3. Take values of array elements as an input … | |
Hi I have the following code which is my project I completed section 1 and 2 but it doesn't work could you help figuring why? [CODE=c++] #include<iostream> #include<string> using namespace std; void count(); void reverse(); void encode(); void decode(); int selection; int main() { cout<<"******************"<<endl; cout<<"Welcome To Project"<<endl; cout<<"******************"<<endl; cout<<endl; … | |
Heres a snippet of my code: [code=cplusplus] int main(); { string cmd1; int cmd2; cout << "Command: " << flush; cin >> cmd1; if (cmd1 == "playlist") { cin >> cmd2; if (cmd2==XXXXXX) { cout << "Illegal command: " << cmd1 << endl; } else cmdPlaylist(cmd2); } return 0; } … | |
I hav two points on the ground at different distances from me . I have the angle swept by my eyes in going from one point to the other. But a camera performs this action by first panning(moving horizontally ) and then tilting(vertical depression or elevation.) Is there a formula … | |
Hello to all. On the internet I often find many C/C++ source files together with a makefile with extension *.in. These files should be used to generate a configuration script with GNU Autoconf. I don't know how to use GNU Autoconf. Do you know how I can compile the source … | |
Ok, well I have an assignment, and I'll be needing some help. First off, I need help on counting the number of from a text file. I'm not sure if I should do a loop eg : [code]for (j=0, j<26; j++)[/code] or there may be an easier way. I have … | |
can anyone please help me with converting from image to world coordinates? Once i get the world coordinates how do i make use of the Z coordinate to show the 3d? thanks in advance:) |
The End.