49,761 Topics
| |
I was trying to input strings into a structure I made, but I couldn't succeed. I use Visual C++ 2010 Express Edition. The code is this: [CODE]#include<iostream> #include<conio.h> #include<stdio.h> #include<string.h> using namespace std; struct schrec { char childname[20]; int childage; }; void main() { schrec record[20]; int n; cout<<"How many … | |
Hey there! I'm trying to write a program in C++ that will read information in from a file and then tell the user how many strings are in the file and the lengths of the smallest and longest strings. I know I can figure out the length of the strings … | |
Hi! I am working on a program to count the number of characters and words in a text file. The counting characters portion works, but my countWords function displays '0'. I built the countWords function on the basis of my countChar function, but since it's returning zero I'm not sure … | |
Hi everybody, How can i find out if a number is prime or not ? For example : [CODE]#include <iostream> using namespace std; int main () { int number; bool isprime; cin >> number; /*algorithm .............. .............. .............. */ if (isprime == false) { cout << "Not prime"; } else … | |
#include<iostream> #include<conio.h> using namespace std; struct biodata { string fname; string lname; string mname; string address; string pbirth; string dbirth; string religion; string citizen; string civilstat; string gender; string email; }*student; main( ) { int n,i,xx,c,d,a=0,e=1; char b,y; cout<<"how many records?"; cin>>n; cin.ignore( ); student= new biodata[n]; for(i=0;i<n;i++) { cout<<"\nLast … | |
Write a program to accomplish the following tasks: 1. Generate arbitrary number of random integer numbers between [0-100] 2. Save or load the numbers from/to a text file based on user option 3. Search the generated list for an arbitrary number entered by a user 4. Use Linear and Binary … | |
I could get this binary search to work... no matter what number i enter it will say "not found" even if its in the array; until, i sorted the array before searching. So, when making an array to search, i always have to sort it first? [CODE] #include <iostream> #include … | |
Hello, I have this code: [CODE] #include <iostream> #include <string> void main() { std::string a = "Sample"; printf("%s", a); std::cin.get(); } [/CODE] and it prints some I think random letters. Where i made mistake? And how should i change the code to write "Sample"? Thanks for answers and sorry for … | |
I wanna know how can I read a string from input which contains spaces and by string,I mean a string class object. thanks | |
Hi guys, Recently I have been trying to make a program, and Im stuck. I am trying to create a login function where by the first time a user logs in, their username and password are encrypt and placed in a file. Then each time that user logs in, the … | |
i am a c++ beginnner nd i am not getting the point why class is defined before main()function i.e globally:-O | |
See I probably have the littlest knowledge on working with Linked Lists and I was thinking of creating a program that will accept three numbers which will be arranged on the list. However, I need to display the numbers everytime I input them, which I don't know how. My goal … | |
So this is a topic asking for a good explanation if possible rather than code fixes :) So I had this code which originally took two parameters of pointer type and then I changed it to pointer references (or reference pointers?) (tell me which one it is) and it started … | |
Hello. I am working on many c++ programs right now that are mostly run in the form of an exe. I have noticed that most programs that i aquire from other people have some sort of installer. I can see how you would need to get all program files in … | |
Hello! I am working on a problem to count characters (without using strings) and I got my program to work! However, I got it to work before I put the code that counts characters into a function (countChar), which is required for this assignment. I'm not sure I understand how … | |
hi! i need help by creating a program that will divide using loops wihout using any division or multiplication sign. the allowed signs are just addition and subtraction. Thank you! i will post my program if someone replies with this. | |
When I was a student, I believe that most of the software programmers of every software companies must be very talented, brilliant, skillful and much more experience than me, at least before I got my first job, I really believe that every software companies could let me learn a lot.But … | |
back again with another question. i created a simple window in WIN32 mode, but it's giving me a linker error that i cannot isolate. [CODE]#include <windows.h> #include <tchar.h> #include <stdio.h> //defined this for all processes HINSTANCE hInstance; LRESULT CALLBACK WinProc(HWND hWnd, UINT msg, LPARAM lParam, WPARAM wParam); //WndProc Prototype. always … | |
Hey I am trying to have a combo box read the first child node in my xml file and formulate a list on that. Everything I keep seeing relates to C# and thus doesn't work very well. I was originally thinking of doing this by doing an event on the … | |
Hi, If i have to use managed code with unmanaged code. What are the possible risks? Thanks in advance. [CODE] cliext::vector<int> ^vec = gcnew vector<int>(3); [/CODE] | |
I have looked at several of similar topics and compared them with my code, but I don't see any of the same problems. Can someone else tell me if they see something wrong? Dev-C++ says "expected primary-expression before 'int'" and "expected ';' before 'int'" and that they are on line … | |
| Does anyone have an algorithm that generates all 10-digit integers that have at least one digit repeated? Trawling through all 9000000000 of them and checking them individually is too slow. Thanks. |
I wrote this program to make a linked list that holds a polynomial, which I then use in various operations. However, the program will not run at all. It builds correctly, but when I try to run it, it will either not come up at all, or it will come … | |
Hi mates, I am using visual c++ . I need to remove those lines which are full of zeros. Here is the matrice[5,7] : [CODE] 2 2 9 8 7 3 4 [COLOR="Red"]0 0 0 0 0 0 0[/COLOR] 3 4 5 7 8 9 6 [COLOR="Red"] 0 0 0 … | |
Hi, Need some help with MIPS I need to write a MIPS code that reads 10 characters string and then only print out value of 3rd, 5th and 7th character (remembering that first character is character 0) OUTPUT (should be somewhat like this): Enter 10 character string : i love … | |
Hello, i have a little big problem. I have an application that needs to 'download' two exe files but i don't want to make internet connections and ... So my application verifies the system time and should 'extract' the .exe for x64 or x86. But i don't know how to … | |
#include<iostream.h> #include<conio.h> int lsearch(int[],int,int); int main() { int ar[50],n,item,index; cout<<"enter the size"; cin>>n; cout<<"enter the array\n"; for(int i=0;i<n;i++) cin>>ar[i]; char ch ='y'; while (ch=='y') { cout<<"enter the no. to be deleted\n"; cin>>item; index=lsearch(ar,n,item); if(index!=-1) ar[index]=0; else {cout<<"sorry!no such element found";} cout<<"the deleted element is shown as (0)\n"; for(int i=0;i<n;i++) cout<<ar[i]<<"\n"; … | |
I was going through old programming tests from school and cam across this one that I got wrong and was wondering if anybody could help me out. We maintain our user list as an encrypted text file with the extension .LBE. We have a customer that is reporting that their … | |
/*any suggestions on how to convert a hexadecimal no. into others and vice versa?d code might be long, i'm just 16, dnt be harsh :)*/ #include<iostream.h> #include<conio.h> #include<string.h> #include<math.h> #include<process.h> main() { char a[30],ch; int len,i,j,pos,whole=0,k=0,n=0,r[30],lenr=0,lenq=0,q[30],h=0,base,base1; float frac=0; cout<<"Enter number"; gets(a); cout<<"Enter choice-b,o,h,d"; cin>>ch; len=strlen(a); switch(a[0])//for converting the no. inputted … | |
hi, i need to ask how to generate the negative answer? i have one formula. But always give me positive answer.. For exmaple: [B]AllocatDiff2 = 100 * -0.05;[/B] hope somebody can help me ...ASAP!! Thanks ... |
The End.